Skip to content

Node.js based forum software built for the modern web

added new hook that is called before templates are compiled

Julian Lamdd050c81774f
diff --git a/src/meta/templates.js b/src/meta/templates.js
index 9a5aa5c72b..8df981c572 100644
--- a/src/meta/templates.js
+++ b/src/meta/templates.js
@@ -42,10 +42,14 @@ Templates.compile = function(callback) {
}
}
- plugins.getTemplates(function(err, pluginTemplates) {
+ async.waterfall([
+ async.apply(plugins.fireHook, 'static:templates.precompile', {}),
+ async.apply(plugins.getTemplates)
+ ], function(err, pluginTemplates) {
if (err) {
return callback(err);
}
+
winston.verbose('[meta/templates] Compiling templates');
rimraf.sync(viewsPath);
mkdirp.sync(viewsPath);