fis-postprocessor-bdtmpl

0.1.2 • Public • Published

fis-postprocesser-bdtmpl

让html支持通过json渲染模板

安装

npm install -g fis-postprocessor-bdtmpl

使用方法

配置

fis.match('**.html', {
    postprocessor: fis.plugin('bdtmpl')
});

使用

模板语法采用BaiduTemplate

渲染引入的模板

<!-- TMPL={ "title": "前端示例" } -->
    <link rel="import" href="/components/head/head.html?__inline">
<!-- /TMPL -->

直接渲染html

<!-- TMPL={ "title": "前端示例" } -->
    <div><%= title =></div>
<!-- /TMPL -->

使用json文件作为数据源

<!-- TMPL=./data.json -->
    <link rel="import" href="/components/head/head.html?__inline">
<!-- /TMPL -->

Package Sidebar

Install

npm i fis-postprocessor-bdtmpl

Weekly Downloads

1

Version

0.1.2

License

ISC

Last publish

Collaborators

  • colorpeach