gulp-nunjucks-render
Render Nunjucks templates
Issues with the output should be reported on the Nunjucks issue tracker.
Install with npm
npm install --save-dev gulp-nunjucks-render
var gulp = require('gulp');
var nunjucksRender = require('gulp-nunjucks-render');
gulp.task('default', function () {
gulp.src('templates/list.html')
.pipe(nunjucksRender())
.pipe(gulp.dest('dist'));
});
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" />
MIT © Carlos G. Limardo
Sindre Sorhus who wrote the original gulp-nunjucks for precompiling Nunjucks templates. I updated his to render instead of precompile.