mirror of https://gitgud.io/fatchan/jschan.git
parent
e4009bc40e
commit
17b6a0a47f
3 changed files with 17 additions and 5 deletions
@ -0,0 +1,14 @@ |
||||
'use strict'; |
||||
|
||||
const util = require('util') |
||||
, fs = require('fs') |
||||
, pug = require('pug') |
||||
, path = require('path') |
||||
, writeFile = util.promisify(fs.writeFile) |
||||
, uploadDirectory = require(__dirname+'/uploadDirectory.js') |
||||
, pugDirectory = path.join(__dirname+'/../views/pages'); |
||||
|
||||
module.exports = async (htmlName, pugName, pugVars) => { |
||||
const html = pug.renderFile(`${pugDirectory}/${pugName}`, pugVars); |
||||
return writeFile(`${uploadDirectory}/htmlName`, html); |
||||
}; |
Loading…
Reference in new issue