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