It's possible to use Environment functions in gulp-nunjucks-render? -


i want use nunjucks render, function. example addglobal.

is possible?

the typical other way add variables use nunjucks enviorment's , use addglobal.

gulp nunjucks render built handles it's own environments (as default nunjucks behavior), , stated can pass variables object on render call.

that being said, give ability control own environment looks like. after tinkering able create own environemnt using:

var nunjucksrender = require('gulp-nunjucks-render');  var nunenv = new nunjucksrender.nunjucks.environment([loaders], [opts]); 

at point can handle manually per enviroment doc listed above, , use addglobal desire. bit more work though default usage described here, https://github.com/carlosl/gulp-nunjucks-render


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -