From f095bf7bab9fa297ea0f677830165325ed78dff0 Mon Sep 17 00:00:00 2001 From: gcoda Date: Fri, 12 May 2017 11:01:27 +0300 Subject: [PATCH] Exposing require and item to use in templates --- lib/render.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/render.js b/lib/render.js index b59b321..e67342b 100644 --- a/lib/render.js +++ b/lib/render.js @@ -171,6 +171,8 @@ function start(data, json) { // Render to HTML. return pugFn({ + require: require, + item: item, $: markFile.normal.meta, html: markFile.normal.html, blocks: markFile, @@ -211,6 +213,7 @@ function singleStart(data, template, options, callback) { return q.fcall(function () { var pugFn = pug.compile(template, options.pug); return pugFn({ + require: require, $: markFile.normal.meta, html: markFile.normal.html, blocks: markFile, @@ -255,4 +258,4 @@ module.exports = function(arg1, arg2, arg3, arg4) { } return renderSync(arg1); -}; \ No newline at end of file +};