scvnc / hexo-renderer-nunjucks

Nunjucks renderer for Hexo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hexo-renderer-nunjucks

Nunjucks renderer plugin for Hexo.

npm Version ISC License Dependencies Status devDependencies Status

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 is false 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)

About

Nunjucks renderer for Hexo

License:ISC License


Languages

Language:TypeScript 100.0%