diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-18 10:04:23 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-18 10:04:23 +0100 |
commit | b66242db985fd8d6088b52d4b089f0de2ecb8058 (patch) | |
tree | e11467b9ada96d5fdd510b2d3a08ceae8b575329 /lib/output/base.js | |
parent | 004ac8851622cb4583b5569ae3480344855a7880 (diff) | |
download | gitbook-b66242db985fd8d6088b52d4b089f0de2ecb8058.zip gitbook-b66242db985fd8d6088b52d4b089f0de2ecb8058.tar.gz gitbook-b66242db985fd8d6088b52d4b089f0de2ecb8058.tar.bz2 |
Add filter resolveAsset to template for website
Diffstat (limited to 'lib/output/base.js')
-rw-r--r-- | lib/output/base.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/output/base.js b/lib/output/base.js index 7b527da..e674f46 100644 --- a/lib/output/base.js +++ b/lib/output/base.js @@ -173,6 +173,14 @@ Output.prototype.getPageContext = function(page) { ); }; +// Resolve a file path in the context of a specific page +// Result is an "absolute path relative to the output folder" +Output.prototype.resolveForPage = function(page, href) { + if (_.isString(page)) page = this.book.getPage(page); + + href = page.relative(href); + return this.onRelativeLink(page, href); +}; // Filename for output // READMEs are replaced by index.html |