summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/node_modules/oktemplate/index.js7
-rw-r--r--examples/templates/index.liquid (renamed from examples/templates/index.mustache)1
-rw-r--r--examples/templates/page.liquid (renamed from examples/templates/page.mustache)0
-rw-r--r--examples/templates/project.liquid (renamed from examples/templates/project.mustache)0
4 files changed, 5 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,
diff --git a/examples/templates/index.mustache b/examples/templates/index.liquid
index 9933064..21d8764 100644
--- a/examples/templates/index.mustache
+++ b/examples/templates/index.liquid
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
+ <link rel="stylesheet" href="css/main.css">
</head>
<body>
{{meta.project}}
diff --git a/examples/templates/page.mustache b/examples/templates/page.liquid
index f7d899f..f7d899f 100644
--- a/examples/templates/page.mustache
+++ b/examples/templates/page.liquid
diff --git a/examples/templates/project.mustache b/examples/templates/project.liquid
index dac1d8d..dac1d8d 100644
--- a/examples/templates/project.mustache
+++ b/examples/templates/project.liquid