Releases: koajs/koa-hbs
Releases · koajs/koa-hbs
v0.7.0
Features
Add support for koa state
app.get('/path', function *() {
this.state = {foo: 'bar'};
// this.state is used as locals for template render
yield this.render('template');
Add disableCache option
Pass disableCache: true
in your options to cause templates to be reloaded each render.
Bug Fix
Support block helpers
block
Specify a block
in your layout:
{{#block "sidebar"}}
<!-- default sidebar content -->
{{/block}}
contentFor
Fill the block with contentFor
helper
{{#contentFor "sidebar"}}
<aside>
<p>{{sidebarContent}}</p>
</aside>
{{/contentFor}}
Fix log issue
v0.3.1 Remove unintentional log output
Layout Support
- Add support for default layout
- Add support for alternative layouts
Update API, Partials, Helpers
The primary API now uses Koa middleware to attach itself to the application:
app.use(hbs.middleware({
viewPath: __dirname + '/views'
}));
- Added support for synchronous helpers
- Added support for partials and directories of partials
v0.1.1: Update package.json
Include repo url
Can render
v0.1.0 Minmally viable hbs render ability