Open shellandbull opened 5 years ago
I've using ".hbs" for the last two years...
app.engine('.hbs', require('express-handlebars')({
defaultLayout: '',
extname: '.hbs',
helpers: require(require('path').join(__dirname, 'lib/helpers.js')).helpers,
layoutsDir: require('path').join(__dirname, 'templates/layouts'),
partialsDir: __dirname + '/templates/partials'
}))
Agree that the docs is not being explicit enough. This is the setting that made it work for me with the understanding that my views are within my app directory:
app.engine('hbs', exphbs({ defaultLayout: 'main', extname: '.hbs', layoutsDir: 'app/views/layouts', partialsDir: 'app/views/partials' })); app.set('views', 'app/views/') app.set('view engine', 'hbs');
Overly minor but, noticed the following reading through the docs:
Is the engine we should set using the lib handlebars or .hbs? Happy to contribute a readme fix