-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get the handlebar instance #242
Comments
It is exposed via the const layouts = require('handlebars-layouts');
const hbs = exphbs.create();
layouts.register(hbs.handlebars); |
The code above allows handlebars-layouts to register, but doesn't allow it to work with express-handlebars. Calling
This is how I'm setting the two up
|
I can fix the issue by manually registering the partial with handlebars. Is there a way to avoid that?
|
You could also configure your Maybe something like this? const handlebars = require('handlebars');
const layouts = require('handlebars-layouts');
const exphbs = require('express-handlebars');
handlebars.registerHelper(layouts(handlebars));
const hbs = exphbs.create({
handlebars: handlebars,
// ... Other config options here (helpers, partialsDir, etc.)
}); |
@romellem With your solution, the partials still need to be registered manually, as @dowtkrob suggested above. Otherwise they're not found. |
I'm trying to extend handlebars with helpers from https://github.com/shannonmoeller/handlebars-layouts. To register the helpers i need access to the underlying
handlebars
instance of express-handlebars.How can i get the instance?
The text was updated successfully, but these errors were encountered: