diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output/website.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/output/website.js b/lib/output/website.js index 0beef24..230af71 100644 --- a/lib/output/website.js +++ b/lib/output/website.js @@ -110,6 +110,11 @@ WebsiteOutput.prototype.prepare = function() { return location.normalize(that.resolveForPage(this.ctx.file.path, href)); }); + // Test if a file exists + that.env.addFilter('fileExists', function(href) { + return fs.existsSync(that.resolve(href)); + }); + // Transform a '.md' into a '.html' (README -> index) that.env.addFilter('contentURL', function(s) { return location.normalize(that.outputUrl(s)); |