shannonmoeller / handlebars-layouts

Handlebars helpers which implement layout blocks similar to Jinja, Nunjucks (Swig), Pug (Jade), and Twig.
http://npm.im/handlebars-layouts
MIT License
361 stars 29 forks source link

Example of using it with express-handlebars #45

Closed Kostanos closed 5 years ago

Kostanos commented 5 years ago

Hi, is this module still up to date?

Can you show the example of how to use it with express-handlebars, if they are compatible. PS. I use express-handlebars this way:

    this.app.engine('.hbs', exphbs({extname: '.hbs'}));
    this.app.set('view engine', '.hbs');
    this.app.set('view options', { layout: 'main' });

But having the issue of adding handlebars-layouts to it.

The following doesn't work, and gives me error - Missing helper "extend", Missing helper "block"

    layouts.register(handlebars);
// or
    handlebars.registerHelper(layouts(handlebars));

Thank you.

shannonmoeller commented 5 years ago

Please see the related issues. Thanks!

https://github.com/shannonmoeller/handlebars-layouts/issues?utf8=%E2%9C%93&q=is%3Aissue+express