diff options
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 |