diff options
Diffstat (limited to 'lib/output/resolveFile.js')
-rw-r--r-- | lib/output/resolveFile.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/output/resolveFile.js b/lib/output/resolveFile.js new file mode 100644 index 0000000..a3a49c5 --- /dev/null +++ b/lib/output/resolveFile.js @@ -0,0 +1,21 @@ +var PathUtils = require('../utils/path'); + +/** + Resolve an absolute path (extracted from a link) + + @param {Output} output + @param {String} filePath + @return {String} +*/ +function resolveFile(output, filePath) { + var pages = output.getPages(); + var page = pages.get(filePath); + + if (!page) { + return filePath; + } + + return PathUtils.setExtension(filePath, '.html'); +} + +module.exports = resolveFile; |