summaryrefslogtreecommitdiff
path: root/app/node_modules/oktemplate/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/node_modules/oktemplate/index.js')
-rw-r--r--app/node_modules/oktemplate/index.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/node_modules/oktemplate/index.js b/app/node_modules/oktemplate/index.js
index 4aec98b..8a725de 100644
--- a/app/node_modules/oktemplate/index.js
+++ b/app/node_modules/oktemplate/index.js
@@ -1,7 +1,8 @@
var fs = require('fs');
var path = require('path');
var glob = require('glob');
-var hogan = require('hogan.js');
+var LiquidEngine = require('liquid-node').Engine;
+var liquid = new LiquidEngine();
/**
* Manages templates. Only supports Mustache currently/
@@ -29,7 +30,14 @@ OKTemplateRepo.prototype._populateCache = function _populateCache(cache) {
files.forEach(function eachFile(file) {
var name = path.basename(file, self._ext);
var templateString = fs.readFileSync(file, {encoding: 'UTF8'});
- cache[name] = hogan.compile(templateString);
+ cache[name] = {
+ name: name,
+ templateString: templateString,
+ render: function(data) {
+ // TODO Not sure if this caches parsed templates behind the scenes?
+ return liquid.parseAndRender(templateString, data);
+ }
+ }
});
}