where the path to layout is expected to be views/layouts without taking into consideration the actual placement of the views folder as configured by this:
app.set('views', __dirname + '/templates');
Current way to resolve such issues is to add an additional configuration using layoutsDir setting:
I think the default shouldn't use views hard-coded, rather use app.get('views') in order to resolve the layouts and partials placement, while, perhaps, defaulting on layouts and partials folders' names.
Hi.
This code (in
server.js
file in the root of the project):where
templates
is (and it is in the root folder, the same with theserver.js
above):produces this (abridged):
The reason for that is this:
https://github.com/ericf/express-handlebars/blob/master/lib/express-handlebars.js#L27
where the path to
layout
is expected to beviews/layouts
without taking into consideration the actual placement of theviews
folder as configured by this:Current way to resolve such issues is to add an additional configuration using
layoutsDir
setting:I think the default shouldn't use
views
hard-coded, rather useapp.get('views')
in order to resolve the layouts and partials placement, while, perhaps, defaulting onlayouts
andpartials
folders' names.I'd do PR, but I am a little stressed on time.