1.0.2 • Published 5 years ago

egg-view-htmling v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

egg-view-htmling

egg view plugin for htmling.

Install

$ npm i egg-view-htmling --save

Usage

// {app_root}/config/plugin.js
exports.htmling = {
  enable: true,
  package: 'egg-view-htmling',
};

// {app_root}/config/config.default.js
exports.view = {
  mapping: {
    '.html': 'htmling',
  },
};

// htmling config
exports.htmling = {};

Create a htmling file

// app/view/hello.html
hello {{data}}

Render it

// app/controller/render.js
exports.htmling = async ctx => {
  await ctx.render('hello.html', {
    data: 'world',
  });
};

License

MIT