Skip to content

Commit

Permalink
add velocity surport
Browse files Browse the repository at this point in the history
  • Loading branch information
小龙 committed Jun 12, 2016
1 parent ebdeda5 commit e223a27
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
22 changes: 22 additions & 0 deletions lib/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,28 @@ function fromStringRenderer(name) {
};
}

/**
* velocity support.
*/

exports.velocityjs = fromStringRenderer('velocityjs');

/**
* velocity string support.
*/

exports.velocityjs.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs'));
try {
options.locals = options;
fn(null, engine.render(str, options).trimLeft());
} catch (err) {
fn(err);
}
});
};

/**
* Liquid support.
*/
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"underscore": "^1.3.3",
"vash": "^0.8.7",
"walrus": "^0.10.1",
"whiskers": "^0.3.3"
"whiskers": "^0.3.3",
"velocityjs": "^0.8.2"
},
"main": "index",
"repository": {
Expand Down

0 comments on commit e223a27

Please sign in to comment.