gulp-nunjucks-render-env
Render Nunjucks templates, with optional Environment.
Issues with the output should be reported on the Nunjucks issue tracker.
Install
Install with npm
npm install --save-dev gulp-nunjucks-render-env
Example
var gulp = ;var nunjucks = ;var nunjucksRender = ; gulp;
Example with gulp data
var gulp = ;var nunjucksRender = ;var data = ; { return example: 'data loaded for ' + filerelative ;} gulp;
API
nunjucks-render(context)
Same context as nunjucks.render()
.
For example
nunjucksRender({css_path: 'http://company.com/css/'});
For the following template
<link rel="stylesheet" href="{{ css_path }}test.css" />
Would render
<link rel="stylesheet" href="http://company.com/css/test.css" />
License
MIT © Carlos G. Limardo
Shout-outs
Sindre Sorhus who wrote the original gulp-nunjucks for precompiling Nunjucks templates. I updated his to render instead of precompile.