koajs / koa-hbs

Handlebars templates for Koa.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support: override layout?

TheEmpty opened this issue · comments

I was looking through the code and didn't see a way to overwrite the layout for a render. Am I right about that? My problem is that my root page has a different layout (or no layout) than the rest of my pages. I was expecting something like

this.render('hero-page', {
  title: "Our Product",
  template: null
});

You can specify {{!< layoutName }} somewhere in your template hero-page to override the default layout. Maybe you can add a layout named empty which only has {{{body}}} in it for the blank pages.

Thanks :)

I had this issue as well. The empty template hack is a nice one but IMO it'd be more intuitive to have it built-in.