handlebars-layout
v0.1.4
Published
A fork of `handlebars-layouts` enables partial by path (Node.js).
Downloads
1,064
Maintainers
Readme
Handlebars Layout
A fork of handlebars-layouts enables partial by path (Node.js).
Install
npm install handlebars-layout
Partial by Path
It will try to load partials of which the references start with either ./
, ../
or /
and not registered yet.
page.hbs
{{!-- reference a partial by path --}}
{{#extend "./layout"}}
{{#content "header"}}
<h1>Goodnight Moon</h1>
{{/content}}
{{#content "main" mode="append"}}
<p>Dolor sit amet.</p>
{{/content}}
{{#content "footer" mode="prepend"}}
<p>MIT License</p>
{{/content}}
{{/extend}}
layout.hbs
<html>
<body>
{{#block "header"}}
<h1>Hello World</h1>
{{/block}}
{{#block "main"}}
<p>Lorem ipsum.</p>
{{/block}}
{{#block "footer"}}
<p>© 1999</p>
{{/block}}
</body>
</html>
Check out original repository for more usage.
License
MIT License.
Created by Shannon Moeller.
This fork is maintained by vilicvane.