Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

sindresorhus/broccoli-nunjucks

Repository files navigation

broccoli-nunjucks

Precompile Nunjucks templates

Issues with the output should be reported on the Nunjucks issue tracker.

Install

npm install --save-dev broccoli-nunjucks

Usage

var nunjucks = require('broccoli-nunjucks');
tree = nunjucks(tree, options);

API

nunjucks(tree, [options])

Same options as nunjucks.precompile() except for name.

options.name

Type: function
Default: Relative template path. Example: templates/list.html

You can override the default behavior by supplying a function which gets the relative path and is expected to return the name.

Example:

nunjucks(tree, {
	name: function (relativePath) {
		return 'tpl-' + relativePath;
	}
});

License

MIT © Sindre Sorhus