egg-view-swig
Use swig Template Engine.
NOTE: swig is NOT MAINTAINED.
Docs: http://node-swig.github.io/swig-templates
Install
$ npm i egg-view-swig --save
Usage
// {app_root}/config/plugin.jsexportsswig = enable: true package: 'egg-view-swig';
Set mapping in config
// {app_root}/config/config.default.jsexportsview = defaultViewEngine: 'swig' mapping: '.tpl': 'swig' ; // {app_root}/config/config.default.jsexportsswig = cache: true;
Set filter
// {app_root}/app/extend/filter.jsexports `hi, .`; // {app_root}/app/controller/{your_controller}.jsexports { ctx;}; // home.tpl name | hello
Render in controller
// {app_root}/app/controller/test.jsexports { ctx;};
Configuration
see config/config.default.js for more detail.
Questions & Suggestions
Please open an issue here.