summaryrefslogtreecommitdiff
path: root/app/node_modules/oktemplate/index.js
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-01 19:04:07 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-01 19:04:07 -0400
commit9d064985eb66f36f10d1fc79f553c51a776be08b (patch)
tree63b854e4972ee4254bd093fb5087b6f2d7599d7f /app/node_modules/oktemplate/index.js
parentc5dddaad2893a5548aefbf2cc87265b73f557aac (diff)
Switch to Liquid templates
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);
+ }
+ }
});
}