Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/languages/coffeekup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var coffeekup = require('coffeekup'),
tpl = {};

exports.compile = function (type, callback) {
tpl[type] = coffeekup.compile(files[type]);
if (!tpl[type]) {
tpl[type] = coffeekup.compile(files[type]);
}
callback();
};

Expand Down
4 changes: 3 additions & 1 deletion lib/languages/ejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var ejs = require('ejs'),
tpl = {};

exports.compile = function (type, callback) {
tpl[type] = ejs.compile(files[type]);
if (!tpl[type]) {
tpl[type] = ejs.compile(files[type]);
}
callback();
};

Expand Down
4 changes: 3 additions & 1 deletion lib/languages/haml.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var Haml = require('haml'),
tpl = {};

exports.compile = function (type, callback) {
tpl[type] = Haml(files[type], {customEscape: "html_escape"});
if (!tpl[type]) {
tpl[type] = Haml(files[type], {customEscape: "html_escape"});
}
callback();
};

Expand Down
4 changes: 3 additions & 1 deletion lib/languages/jade.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var jade = require('jade'),
tpl = {};

exports.compile = function (type, callback) {
tpl[type] = jade.compile(files[type]);
if (!tpl[type]) {
tpl[type] = jade.compile(files[type]);
}
callback();
};

Expand Down
4 changes: 3 additions & 1 deletion lib/languages/jqtpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var jqtpl = require('jqtpl'),
tpl = {};

exports.compile = function (type, callback) {
tpl[type] = jqtpl.template(type, files[type]);
if (!tpl[type]) {
tpl[type] = jqtpl.template(type, files[type]);
}
callback();
};

Expand Down
16 changes: 10 additions & 6 deletions lib/languages/mu2.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ var mu = require('mu2'),
tpl = {};

exports.compile = function (type, callback) {
mu.compileText(type, files[type], function (error, compiled) {
if (error) {
console.log(error);
}
tpl[type] = compiled;
if (!tpl[type]) {
mu.compileText(type, files[type], function (error, compiled) {
if (error) {
console.log(error);
}
tpl[type] = compiled;
callback();
});
} else {
callback();
});
}
};

exports.render = function (type, callback) {
Expand Down
6 changes: 4 additions & 2 deletions lib/languages/swig.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ swig.init({
});

exports.compile = function (type, callback) {
tpl[type] = swig.fromString(files[type]);
if (!tpl[type]) {
tpl[type] = swig.compile(files[type]);
}
callback();
};

exports.render = function (type, callback) {
tpl[type].render(data);
tpl[type](data);
callback();
};
4 changes: 3 additions & 1 deletion lib/languages/templ8.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ var Templ8 = require('Templ8'),


exports.compile = function (type, callback) {
tpl[type] = new Templ8(files[type], { compiled: true });
if (!tpl[type]) {
tpl[type] = new Templ8(files[type], { compiled: true });
}
callback();
};

Expand Down
4 changes: 3 additions & 1 deletion lib/languages/whiskers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var whiskers = require('whiskers'),
tpl = {};

exports.compile = function (type, callback) {
tpl[type] = whiskers.compile(files[type]);
if (!tpl[type]) {
tpl[type] = whiskers.compile(files[type]);
}
callback();
};

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"homepage": "http://paularmstrong.github.com/node-templates/",
"author": "Paul Armstrong <paul@paularmstrongdesigns.com>",
"dependencies": {
"nopt": ">=1.0.8",
"bench": ">=0.3.2",
"nopt": ">=1.0.10",
"bench": ">=0.3.4",
"nodelint": "0.5.2",
"underscore": ">=1.1.7",
"underscore": ">=1.2.3",
"coffeekup": "0.3.0",
"ejs": "0.4.2",
"hamljs": "0.5.1",
"ejs": "0.6.1",
"hamljs": "0.5.2",
"haml": "0.4.2",
"jade": "0.16.0",
"jqtpl": "1.0.6",
"jade": "0.20.0",
"jqtpl": "1.0.7",
"mu2": "0.5.3",
"swig": "0.7.0",
"Templ8": "0.2.1",
Expand Down