Support the view rendering implementation of the scrat pagelet. Depends on the egg-view-swig template view engine.
Pagelet: https://github.com/scrat-team/scrat-swig
NOTE: swig is NOT MAINTAINED.
DOCS: http://node-swig.github.io/swig-templates
$ npm i egg-view-swig-pagelet --save
// {app_root}/config/plugin.js
exports.swigPagelet = {
enable: true,
package: 'egg-view-swig-pagelet',
};
// {app_root}/config/config.default.js
exports.swigPagelet = {
// default layout template config for view base dir
// layout: 'layout/layout.tpl',
// default scrat resource manifest path
// manifest: path.join(app.baseDir, 'config/manifest.json')
};
Render in controller
exports.home = function* (ctx) {
yield ctx.render('home.tpl', { list });
};
see config/config.default.js for more detail.
Please open an issue here.