diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-07 22:18:48 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-07 22:18:48 -0400 |
| commit | 8896617d1b5db8f4c58c08a4fb7361ce9e55281a (patch) | |
| tree | 94d89c8b42267b47b1701551f04b213c34ecc00f /app/node_modules/oktemplate/index.js | |
| parent | 57b72a57449f00938dd80c17c9c138ecee8a2ad4 (diff) | |
Use correct extension for Liquid templates
Diffstat (limited to 'app/node_modules/oktemplate/index.js')
| -rw-r--r-- | app/node_modules/oktemplate/index.js | 7 |
1 files changed, 4 insertions, 3 deletions
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, |
