Skip to content

Releases: koajs/koa-hbs

v0.7.0

Choose a tag to compare

@jwilm jwilm released this 23 Jan 18:12

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

Choose a tag to compare

@jwilm jwilm released this 07 Jan 05:32

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

Support block helpers

Choose a tag to compare

@jwilm jwilm released this 27 Dec 06:34

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

Choose a tag to compare

@jwilm jwilm released this 27 Dec 06:31
v0.3.1

Remove unintentional log output

Layout Support

Choose a tag to compare

@jwilm jwilm released this 27 Dec 04:50
  • Add support for default layout
  • Add support for alternative layouts

Update API, Partials, Helpers

Choose a tag to compare

@jwilm jwilm released this 26 Dec 19:43

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

Choose a tag to compare

@jwilm jwilm released this 25 Dec 03:55
Include repo url

Can render

Choose a tag to compare

@jwilm jwilm released this 25 Dec 02:34
v0.1.0

Minmally viable hbs render ability