hexo-renderer-nunjucks
Nunjucks renderer plugin for Hexo.
Installation
$ npm install hexo-renderer-nunjucks --save
Development
The plugin can be built by running:
$ npm install && npm run build
Configuration
Nunjucks can be configured by editing the main _config.yml
file using the nunjucks
namespace.
Configuration options can be found in Nunjucks API documentation.
- Note:
autoescape
isfalse
by default.
nunjucks:
autoescape: true
Configuring Nunjucks Envrionment
Create a file called nunjucks.config.js
in the root folder which exports a function that takes and configures a Nunjucks environment. Here is an example configuring markdown.
var nunjucks = require('nunjucks'),
markdown = require('nunjucks-markdown'),
marked = require('marked');
module.exports = function (env) {
markdown.register(env, marked);
}
File Extensions
This plugin supports the following file extensions.
.njk
.nunjucks
.j2
(Jinja 2)