diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-12-11 14:40:20 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-12-11 14:40:20 +0100 |
commit | 49f09e46daf75c192e5d7b6b050fe9f9f949a485 (patch) | |
tree | c514b4370a912ba301f62b4f9c90061a454d0824 /lib | |
parent | becd027563f361e7dc6824d18c58978b08aa6118 (diff) | |
download | gitbook-49f09e46daf75c192e5d7b6b050fe9f9f949a485.zip gitbook-49f09e46daf75c192e5d7b6b050fe9f9f949a485.tar.gz gitbook-49f09e46daf75c192e5d7b6b050fe9f9f949a485.tar.bz2 |
Fix support for local styles
Diffstat (limited to 'lib')
-rw-r--r-- | lib/generators/website.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/generators/website.js b/lib/generators/website.js index 1143fe5..efb7c0f 100644 --- a/lib/generators/website.js +++ b/lib/generators/website.js @@ -49,7 +49,12 @@ Generator.prototype.prepareStyles = function() { this.styles = _.chain(this.styles) .map(function(style) { var stylePath = that.options.styles[style]; - if (stylePath && fs.existsSync(that.book.resolveOutput(stylePath))) { + var styleExists = ( + fs.existsSync(that.book.resolveOutput(stylePath)) || + fs.existsSync(that.book.resolve(stylePath)) + ); + + if (stylePath && styleExists) { return [style, stylePath]; } return null; |