diff options
-rw-r--r-- | lib/book.js | 6 | ||||
-rw-r--r-- | lib/generators/website.js | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/book.js b/lib/book.js index 93c9486..9ba27f3 100644 --- a/lib/book.js +++ b/lib/book.js @@ -736,6 +736,12 @@ Book.prototype.resolve = function() { return pathUtil.resolveInRoot.apply(null, [this.root].concat(_.toArray(arguments))); }; +// Resolve a path in the book output +// Enforce that the output path in the output folder +Book.prototype.resolveOutput = function() { + return pathUtil.resolveInRoot.apply(null, [this.options.output].concat(_.toArray(arguments))); +}; + // Convert an abslute path into a relative path to this Book.prototype.relative = function(p) { return path.relative(this.root, p); diff --git a/lib/generators/website.js b/lib/generators/website.js index ecfd98c..1143fe5 100644 --- a/lib/generators/website.js +++ b/lib/generators/website.js @@ -49,7 +49,7 @@ Generator.prototype.prepareStyles = function() { this.styles = _.chain(this.styles) .map(function(style) { var stylePath = that.options.styles[style]; - if (stylePath && fs.existsSync(that.book.resolve(stylePath))) { + if (stylePath && fs.existsSync(that.book.resolveOutput(stylePath))) { return [style, stylePath]; } return null; |