README
think-view-nunjucks
Install
npm install think-view-nunjucks
How to Usage
edit config file src/config/adapter.js
, add options:
const nunjucks = require('think-view-nunjucks');
exports.view = {
type: 'nunjucks',
common: {
viewPath: path.join(think.ROOT_PATH, 'view'),
extname: '.html',
sep: '_' //seperator between controller and action
},
nunjucks: {
handle: nunjucks,
beforeRender: (env, nunjucks, config) => {}
}
}
default options
const defaultOptions = {
autoescape: true,
watch: false,
noCache: false,
throwOnUndefined: false
};
change options:
exports.view = {
type: 'nunjucks',
nunjucks: {
handle: nunjucks,
options: {
tags: {
blockStart: '<%',
blockEnd: '%>',
variableStart: '<