summaryrefslogtreecommitdiffstats
path: root/lib/template/loader.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/template/loader.js')
-rw-r--r--lib/template/loader.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/template/loader.js b/lib/template/loader.js
index 6b54015..23d179a 100644
--- a/lib/template/loader.js
+++ b/lib/template/loader.js
@@ -8,16 +8,22 @@ Simple nunjucks loader which is passing the reponsability to the Output
var Loader = nunjucks.Loader.extend({
async: true,
- init: function(output, opts) {
- this.output = output;
+ init: function(engine, opts) {
+ this.engine = engine;
+ this.output = engine.output;
},
getSource: function(sourceURL, callback) {
+ var that = this;
+
this.output.onGetTemplate(sourceURL)
.then(function(out) {
// We disable cache since content is modified (shortcuts, ...)
out.noCache = true;
+ // Transform template before runnign it
+ out.source = that.engine.interpolate(out.path, out.source);
+
return out;
})
.nodeify(callback);