Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from jafl/partials-not-required

Don't require partialsDir
  • Loading branch information...
commit 7e982abeb0e9f19d96c560d6b7b756d182469d2f 2 parents 7e434da + 45a9ef9
Mario Gutierrez mgutz authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/hbs.js
6 lib/hbs.js
View
@@ -80,12 +80,12 @@ function cachePartials() {
* @param {Object} options - { handlebars: "override handlebars", partialsDir: "absolute path to partials", extname: "extension to use" }
*/
exports.express3 = function(options) {
- if (options.handlebars) exports.handlebars = options.handlebars;
+ if (options && options.handlebars) exports.handlebars = options.handlebars;
exports.handlebars.registerHelper('contentFor', contentFor);
exports.handlebars.registerHelper('block', block);
- partialsDir = options.partialsDir;
+ partialsDir = options && options.partialsDir;
if (partialsDir) cachePartials();
return _express3;
@@ -102,7 +102,7 @@ var _express3 = function(filename, options, cb) {
// Force reloading of all partials if cachine not used. Inefficient but there
// is no loading partial event.
- if (!options.cache) cachePartials();
+ if (!options.cache && partialsDir) cachePartials();
/**
* Allow a layout to be declared as a handlebars comment to remain spec compatible
Please sign in to comment.
Something went wrong with that request. Please try again.