nunjucks-brunch
Adds nunjucks support to brunch.
Usage
Install the plugin via npm with npm install nunjucks-brunch --save
.
Or, do manual install:
- Add
"nunjucks-brunch": "x.y.z"
topackage.json
of your brunch app. Pick a plugin version that corresponds to your minor (y) brunch version. - If you want to use git version of plugin, add
"nunjucks-brunch": "git@github.com:PxlBuzzard/nunjucks-brunch.git"
.
Brunch plugin settings
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'