fis-parser-html-ejs
v0.0.2
Published
a parser plugin for fis to compile html with ejs
Downloads
1
Readme
fis-parser-html-ejs
a parser plugin for fis to compile html file with ejs
usage
install
npm install -g fis-parser-html-ejs
configure
//tell fis that parse `.html` file by using `fis-parser-html-ejs` plugin fis.config.set('modules.parser.html', 'html-ejs'); fis.config.set('setting.parser.html-ejs',{sub:'/'});
inline html file
source:
/********************************** * index.html content: ********************************** <ul> <script type="text/ejs" data-json="config/data.json"> <% for(var i=0;i<list.length;i++){ %><li><img src="<%=list[i]%>" /></li><% } %> </script> </ul> **********************************/
/********************************** * src/config/data.json content: ********************************** { "list":["img/1.jpg","img/2.jpg"] } **********************************/
release:
/********************************** * index.html content: ********************************** <ul> <li><img src="img/1.jpg" /></li> <li><img src="img/2.jpg" /></li> </ul> **********************************/