0.1.2 • Published 8 years ago

fis-postprocessor-bdtmpl v0.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

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 -->
0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago