A Handlebars view engine for Express.
Layouts:
{{!< layout}}
)Partials:
views/partials
)hbs
and html
)Helpers:
views/helpers
)Block inheritance:
Variables:
@variables
that can be accessed from any context in a templatePrecompiling:
Instances:
Installation:
$ npm install exphbs
Registering view engine:
app.engine('hbs', require('exphbs'));
app.set('view engine', 'hbs');
Default directory structure:
.
├── app.js
└─┬ views/
├── index.hbs
├── helpers/
├── layouts/
└── partials/
Check out example directory for a complete example. You can play around with it on Runnable.
$ npm install
$ npm test
MIT