From 8896617d1b5db8f4c58c08a4fb7361ce9e55281a Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Tue, 7 Apr 2015 22:18:48 -0400 Subject: Use correct extension for Liquid templates --- app/node_modules/oktemplate/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/node_modules/oktemplate/index.js') diff --git a/app/node_modules/oktemplate/index.js b/app/node_modules/oktemplate/index.js index 75d7e6f..09a78bf 100644 --- a/app/node_modules/oktemplate/index.js +++ b/app/node_modules/oktemplate/index.js @@ -26,7 +26,7 @@ liquid.registerFilters({ function OKTemplateRepo(options) { options = options || {}; this._root = options.root || 'templates'; - this._ext = options.ext || '.mustache'; + this._extPattern = options.ext || '.+(liquid|html)'; this._cache = {}; this._populateCache(this._cache); } @@ -42,9 +42,10 @@ OKTemplateRepo.prototype.getTemplate = function getTemplate(name) { */ OKTemplateRepo.prototype._populateCache = function _populateCache(cache) { var self = this; - var files = glob.sync(this._root + '/*' + this._ext); + var files = glob.sync(this._root + '/*' + this._extPattern); files.forEach(function eachFile(file) { - var name = path.basename(file, self._ext); + var ext = path.extname(file); + var name = path.basename(file, ext); var templateString = fs.readFileSync(file, {encoding: 'UTF8'}); cache[name] = { name: name, -- cgit v1.2.3-70-g09d2