diff options
Diffstat (limited to 'lib/output/website.js')
-rw-r--r-- | lib/output/website.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/output/website.js b/lib/output/website.js index a208802..f58c68f 100644 --- a/lib/output/website.js +++ b/lib/output/website.js @@ -77,15 +77,20 @@ WebsiteOutput.prototype.prepare = function() { // Transform an absolute path into a relative path // using this.ctx.page.path - that.env.addFilter('resolveFile', function(s) { - // todo - return s; + that.env.addFilter('resolveFile', function(href) { + return that.resolveForPage(this.ctx.file.path, href); }); // Transform a '.md' into a '.html' (README -> index) that.env.addFilter('contentURL', function(s) { return that.onRelativeLink(null, s); }); + + // Relase path to an asset + that.env.addFilter('resolveAsset', function(href) { + href = path.join('/gitbook', href); + return that.resolveForPage(this.ctx.file.path, href); + }); }); }; |