ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 384 forks source link

Intergrating with Swag #69

Closed markbarton closed 10 years ago

markbarton commented 10 years ago

I looked at the closed issue (#47) but can't seem to get Swag - https://github.com/elving/swag to work with hbs - using Express 4 if this makes any difference.

Swag wants to call registerHelpers on the handlebars instance - this method doesnt exist - I am probably missing something obvious.

Any help?

markbarton commented 10 years ago

As soon as I posted I solved the issue - apologies.

The solution was as simple as:

var hbs = exphbs.create({ defaultLayout: 'main', partialsDir: [ 'views/partials/' ], extname:'.handlebars'

});

Swag.registerHelpers(hbs.handlebars);

ericf commented 10 years ago

Glad you got it figured out!

chichilatte commented 10 years ago

Thanks Mark!

molinto commented 9 years ago

Brilliant timesaver thanks Mark!

wascou commented 8 years ago

Cheers