Closed antonfisher closed 8 years ago
Hello Carlos, What do you think about configurable default options? I implemented this for multiple rendering:
var nunjucksRender = require('gulp-nunjucks-render'); template1.pipe(nunjucksRender({ path: ['/templates'], // repeat or merge with different 'data' property envOptions: { autoescape: false }, data: {...} })); ... templateN.pipe(nunjucksRender({ path: ['/templates'], // repeat or merge with different 'data' property envOptions: { autoescape: false }, data: {...} }));
Will be replaced with:
var nunjucksRender = require('gulp-nunjucks-render'); nunjucksRender.setDefaults({ path: ['/templates'], envOptions: { autoescape: false } }); template1.pipe(nunjucksRender({data: {...}})); ... templateN.pipe(nunjucksRender({data: {...}}));
Thank you.
Thanks I like this. I have to find time to document it before updating it to NPM and bumping the version though.
Hello Carlos, What do you think about configurable default options? I implemented this for multiple rendering:
Will be replaced with:
Thank you.