gulp-hogan
gulp plugin to compile hogan templates.
Usage
First, install gulp-hogan
as a development dependency:
npm install --save-dev gulp-hogan
Then, add it to your gulpfile.js
:
Say our template.hogan
is :
Follow @{{handle}}.
var hogan = ; gulp;
Now dist will have template.js
with content as Follow @gnumanth
Template inheritance & Partials
Partials will be rendered recursively, allowing for template inheritance.
Example:
Folder structure
|-- templates
|-- page.hogan
|-- body.hogan
|-- partials
| |-- header.hogan
| |-- footer.hogan
page.hogan
Page{{> body }}
body.hogan
{{> partials/header }}{{> partials/footer }}
header.hogan
Logo {{#image}}{{/image}}
footer.hogan
Copyright {{year}}
gulpfile.js
var hogan = ; gulp;
dist/page.html
Page Logo Copyright 2016