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.js7
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,