Adds Nunjucks support to Brunch.
- Install the plugin via npm with
npm install --save-dev nunjucks-brunch
. - If you want to use git version of plugin:
npm install --save-dev brunch/nunjucks-brunch
.
If customization is needed or desired, settings can be modified in your brunch
config file (such as config.coffee
):
-
templatePath: Default
app/views
. The top-level directory where your nunjucks templates are stored. Note: Windows users will want to useapp\\views
. -
pathReplace: (RegExp) Default
/^app(\/|\\)views(\/|\\).*.html$/
. Sets the regular expression applied against the source file path to create the module name. Matched characters are removed. -
Custom Variables: Any variable you define can be referenced in a nunjucks template. For example,
{{ github_username }}
would output toPxlBuzzard
using the example below.
Example:
exports.config =
...
plugins:
nunjucks:
github_username: 'PxlBuzzard'
Thanks Daniel Jost for creating and maintaining first versions of the plugin.