Skip to content

Commit

Permalink
UPDATE: default config assign update
Browse files Browse the repository at this point in the history
  • Loading branch information
dogbutcat committed Feb 21, 2019
1 parent 5d27bb5 commit 9eb6a55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/express-handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function ExpressHandlebars(config) {
utils.assign(this, {
handlebars : Handlebars,
extname : '.handlebars',
layoutsDir : 'views/layouts/',
partialsDir : 'views/partials/',
// layoutsDir : 'views/layouts/',
// partialsDir : 'views/partials/',
defaultLayout : undefined,
helpers : undefined,
compilerOptions: undefined,
Expand Down Expand Up @@ -191,8 +191,8 @@ ExpressHandlebars.prototype.renderView = function (viewPath, options, callback)
var viewsPath = options.settings && options.settings.views;
if (viewsPath) {
view = this._getTemplateName(path.relative(viewsPath, viewPath));
this.partialsDir = path.join(viewsPath, 'partials/');
this.layoutsDir = path.join(viewsPath, 'layouts/');
this.partialsDir = this.partialsDir || path.join(viewsPath, 'partials/');
this.layoutsDir = this.layoutsDir || path.join(viewsPath, 'layouts/');
}

// Merge render-level and instance-level helpers together.
Expand Down

0 comments on commit 9eb6a55

Please sign in to comment.