Nunjucks templates for Wintersmith
npm install -g wintersmith-nunjucks
From the nunjucks documentation at http://jlongster.github.io/nunjucks/templating.html#filters:
Filters are essentially functions that can be applied to variables. They are called with a pipe operator (|) and can take arguments.
For more information on how to write customer Filters, take a look at the API documentation page at: http://jlongster.github.io/nunjucks/api#custom-filters
To use customer filters with wintersmith, put the filter in its own file stored in a filters directory. The filename has to be the name of the filter + '.js'.
so if your filter is in './filters/myfirstfilter.js' add a nunjucks section like this to your config.json:
"nunjucks":"filterdir": "filters""filters": "myfirstfilter"
It will be available in your templates at 'myfirstfilter'
this specific filter would then be available as
date in your templates.
As of nunjucks 2.0.0 autoescaping was turned on by default. As of v1.0 this plugin also defaults to autoescaping turned on. If you want to change behaviour for pre-v1.0 compatibility you can control it with the autoescape option in your config.json.