Adds Nunjucks support to Brunch.
npm install --save-dev nunjucks-brunch
.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 use app\\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 to PxlBuzzard
using the example below.
Example:
exports.config =
...
plugins:
nunjucks:
github_username: 'PxlBuzzard'
Thanks Daniel Jost for creating and maintaining first versions of the plugin.