I want to use Nunjucks templates but want to pass in my own JSON data to be used on the templates.
The documentation here is pretty sparse.
https://mozilla.github.io/nunjucks/templating.html
Thank you.
I want to use Nunjucks templates but want to pass in my own JSON data to be used on the templates.
The documentation here is pretty sparse.
https://mozilla.github.io/nunjucks/templating.html
Thank you.
You can use gulp-data which allows you to pass json files to the task runner you're using to render Nunjucks.
You can use their async render to achieve that.
https://mozilla.github.io/nunjucks/api.html#render