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
{{#block "header"}} Hello World {{/block}} {{#block "main"}} Lorem ipsum. {{/block}} {{#block "footer"}} © 1999 {{/block}}
Check out original repository for more usage.
License
MIT License.
Created by Shannon Moeller.
This fork is maintained by vilicvane.