Skip to content

Commit

Permalink
Merge pull request #148 from camabeh/master
Browse files Browse the repository at this point in the history
Fixes #147
  • Loading branch information
sahat committed May 2, 2016
2 parents 077a667 + fff4a60 commit a66aad4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/express-handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,14 @@ ExpressHandlebars.prototype.renderView = function (viewPath, options, callback)

// Express provides `settings.views` which is the path to the views dir that
// the developer set on the Express app. When this value exists, it's used
// to compute the view's name.
// to compute the view's name. Layouts and Partials directories are relative
// to `settings.view` path
var view;
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/');
}

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

0 comments on commit a66aad4

Please sign in to comment.