beaulac / nunjucks-brunch

Adds nunjucks support to Brunch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nunjucks-brunch Build status Latest version Test coverage

Adds Nunjucks support to Brunch.

Usage

  • 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.

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 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'

Gratitude

Thanks Daniel Jost for creating and maintaining first versions of the plugin.

About

Adds nunjucks support to Brunch


Languages

Language:JavaScript 55.6%Language:CoffeeScript 42.8%Language:HTML 1.6%