summaryrefslogtreecommitdiffstats
path: root/lib/generators
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-12-11 14:40:20 +0100
committerSamy Pessé <samypesse@gmail.com>2015-12-11 14:40:20 +0100
commit49f09e46daf75c192e5d7b6b050fe9f9f949a485 (patch)
treec514b4370a912ba301f62b4f9c90061a454d0824 /lib/generators
parentbecd027563f361e7dc6824d18c58978b08aa6118 (diff)
downloadgitbook-49f09e46daf75c192e5d7b6b050fe9f9f949a485.zip
gitbook-49f09e46daf75c192e5d7b6b050fe9f9f949a485.tar.gz
gitbook-49f09e46daf75c192e5d7b6b050fe9f9f949a485.tar.bz2
Fix support for local styles
Diffstat (limited to 'lib/generators')
-rw-r--r--lib/generators/website.js7
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;