Skip to content

liperuf/gulp-nunjucks-render

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gulp-nunjucks-render

Render Nunjucks templates

Issues with the output should be reported on the Nunjucks issue tracker.

Install

Install with npm

npm install --save-dev gulp-nunjucks-render

Example

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'));
});

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="proxy.php?url=https%3A%2F%2Fgithub.com%2F%7B%7B+css_path+%7D%7Dtest.css" />

Would render

<link rel="stylesheet" href="proxy.php?url=http%3A%2F%2Fcompany.com%2Fcss%2Ftest.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.

About

[Gulp](https://github.com/wearefractal/gulp) plugin to render [Nunjucks](http://jlongster.github.io/nunjucks/) templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors