Skip to content

Releases: koajs/koa-hbs

v0.7.0

23 Jan 18:12
Compare
Choose a tag to compare

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

07 Jan 05:32
Compare
Choose a tag to compare

Hbs.registerPartials throws an error when called and partialsPath is not set. Added check for partialsPath before yielding registerPartials().

Support block helpers

27 Dec 06:34
Compare
Choose a tag to compare

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

27 Dec 06:31
Compare
Choose a tag to compare
v0.3.1

Remove unintentional log output

Layout Support

27 Dec 04:50
Compare
Choose a tag to compare
  • Add support for default layout
  • Add support for alternative layouts

Update API, Partials, Helpers

26 Dec 19:43
Compare
Choose a tag to compare

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

25 Dec 03:55
Compare
Choose a tag to compare
Include repo url

Can render

25 Dec 02:34
Compare
Choose a tag to compare
v0.1.0

Minmally viable hbs render ability