From 3dc52e9a9cef47ca143831b85cfe5f0e595554a3 Mon Sep 17 00:00:00 2001 From: Manuel Bieh Date: Sun, 13 Jan 2013 16:57:23 +0100 Subject: [PATCH] Using express default 'views' dir for partials when using subfolders --- lib/consolidate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/consolidate.js b/lib/consolidate.js index 3f664ad..50fc6d8 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -109,6 +109,7 @@ function read(path, options, fn) { */ function readPartials(path, options, fn) { + var partialsPath = options && options.settings && options.settings.views || dirname(path); if (!options.partials) return fn(); var partials = options.partials; var keys = Object.keys(partials); @@ -116,7 +117,7 @@ function readPartials(path, options, fn) { function next(index) { if (index == keys.length) return fn(null); var key = keys[index]; - var file = join(dirname(path), partials[key] + extname(path)); + var file = join(partialsPath, partials[key] + extname(path)); read(file, options, function(err, str){ if (err) return fn(err); options.partials[key] = str;