mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
Use Benchpress (#5901)
* Use Benchpress * Use Benchpress.compileParse * Error for template load failure * Use benchpressjs package * Compile templates on demand * Fix user settings page * Fix admin search to exclude `.jst` files * Fix 500-embed So ajaxify can still show an error if the server goes down
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
864321f727
commit
abffc29128
@@ -2,8 +2,8 @@
|
||||
|
||||
var async = require('async');
|
||||
var winston = require('winston');
|
||||
var templates = require('templates.js');
|
||||
var _ = require('lodash');
|
||||
var Benchpress = require('benchpressjs');
|
||||
|
||||
var plugins = require('../plugins');
|
||||
var translator = require('../translator');
|
||||
@@ -93,12 +93,12 @@ function renderWidget(widget, uid, options, callback) {
|
||||
|
||||
if (widget.data.container && widget.data.container.match('{body}')) {
|
||||
translator.translate(widget.data.title, function (title) {
|
||||
html = templates.parse(widget.data.container, {
|
||||
Benchpress.compileParse(widget.data.container, {
|
||||
title: title,
|
||||
body: html,
|
||||
}, function (err, html) {
|
||||
next(err, { html: html });
|
||||
});
|
||||
|
||||
next(null, { html: html });
|
||||
});
|
||||
} else {
|
||||
next(null, { html: html });
|
||||
|
||||
Reference in New Issue
Block a user