diff options
Diffstat (limited to 'lib/output/website/onPage.js')
-rw-r--r-- | lib/output/website/onPage.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/output/website/onPage.js b/lib/output/website/onPage.js index aedb8c0..a5598e4 100644 --- a/lib/output/website/onPage.js +++ b/lib/output/website/onPage.js @@ -1,9 +1,10 @@ var Templating = require('../../templating'); var JSONUtils = require('../../json'); var Modifiers = require('../modifiers'); -var Writer = require('../writer'); +var writeFile = require('../helper/writeFile'); var getModifiers = require('../getModifiers'); var createTemplateEngine = require('./createTemplateEngine'); +var fileToOutput = require('../helper/fileToOutput'); /** Write a page as a json file @@ -13,6 +14,7 @@ var createTemplateEngine = require('./createTemplateEngine'); */ function onPage(output, page) { var options = output.getOptions(); + var file = page.getFile(); var prefix = options.get('prefix'); var engine = createTemplateEngine(output, page.getPath()); @@ -27,12 +29,15 @@ function onPage(output, page) { } }; + // Output file path + var filePath = fileToOutput(output, file.getPath()); + // Render the theme return Templating.renderFile(engine, prefix + '/page.html', context) // Write it to the disk .then(function(html) { - return Writer.writePage(output, resultPage, html); + return writeFile(output, filePath, html); }); }); } |