summaryrefslogtreecommitdiffstats
path: root/lib/output/website.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/output/website.js')
-rw-r--r--lib/output/website.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/output/website.js b/lib/output/website.js
index 32647f6..01021e5 100644
--- a/lib/output/website.js
+++ b/lib/output/website.js
@@ -103,8 +103,10 @@ WebsiteOutput.prototype.prepare = function() {
// Relase path to an asset
that.env.addFilter('resolveAsset', function(href) {
- href = path.join('/gitbook', href);
- return that.resolveForPage(this.ctx.file.path, href);
+ href = path.join('gitbook', href);
+ if (!this.ctx.file) return href;
+
+ return that.resolveForPage(this.ctx.file.path, '/' + href);
});
})