-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
express-handlebars layouts not using "views" setting? #2675
Comments
Hi! Can you start your app with the following command, and paste what is printed on the command line here?
|
Ehh...... probably won't do you any good, but...
Note I removed the path and replaced it with EDIT: the port moved to 8080. Updated my earlier example as well. |
Thanks! I forgot that we are not actually printing all the settings in the debug output (bug! :) ) so that doesn't seem to help. I'll have to try it out, but in the end, the views module you are using, |
I fail to see how is it responsible, since changing the name to But thanks for trying it out. |
Gotcha. Yea, I'm not sure, but I will try to investigate later :) If you do fine the issue in Express, a PR would be welcome! |
This is because we only resolve the |
Ah, I see. Lemme try this with |
Looks like you need to specify the app.engine('hbs', expressHbs({extname:'hbs', defaultLayout:'main.hbs', layoutsDir: __dirname + '/views1/layouts'})); |
views
folder doesn't work.
Yep. My bad. 😵 ... what's the embarrassed emoji name? |
lol. I think it's U+1F633 FLUSHED FACE 😳 I'm going to close this, but it may be worth making a bug over at express-handlebars (or I guess even a PR), because we do provide what the views dir is to the view engine, so the module could default to |
Will move it over there, sure. Thanks. |
Hi.
I am a bit puzzled by this, as there are no reports, yet my various attempts came up with nothing.
Anyway - trying to relocate the
views
folder doesn't work.This code (in
server.js
file in the root of the project):where
views1
is (and it is in the root folder, the same with theserver.js
above):produces this (abridged):
Renaming the folder to
views
and removingapp.set('views', ...);
line makes this work properly.I must be missing something, as this is too basic a functionality to not work.
P.S.
There were additional attempts revolving around using something like this instead (to make sure that the path is resolved properly and whatnot):
to no avail.
The text was updated successfully, but these errors were encountered: