|
@@ -26,9 +26,11 @@ async function generator(configFilename, pageDefinitionFile, distPath){
|
|
// load css
|
|
// load css
|
|
const css = await _fs.readFile(cssPath, 'utf8');
|
|
const css = await _fs.readFile(cssPath, 'utf8');
|
|
|
|
|
|
|
|
+ const lang = pageDefinitionFile.substr(-10, 2);
|
|
|
|
+
|
|
console.log('Create/Empty distribution folder: "'+distPath+'"\n');
|
|
console.log('Create/Empty distribution folder: "'+distPath+'"\n');
|
|
|
|
|
|
- if(_fs.exists(distPath)) {
|
|
|
|
|
|
+ if(await _fs.exists(distPath)) {
|
|
await _fs.rmrf(distPath);
|
|
await _fs.rmrf(distPath);
|
|
}
|
|
}
|
|
await _fs.mkdirp(distPath);
|
|
await _fs.mkdirp(distPath);
|
|
@@ -43,9 +45,12 @@ async function generator(configFilename, pageDefinitionFile, distPath){
|
|
// inject errorcode
|
|
// inject errorcode
|
|
pconf.code = p;
|
|
pconf.code = p;
|
|
|
|
|
|
- // inject foote
|
|
|
|
|
|
+ // inject footer
|
|
pconf.footer = pconf.footer || config.footer;
|
|
pconf.footer = pconf.footer || config.footer;
|
|
|
|
|
|
|
|
+ // inject footer
|
|
|
|
+ pconf.lang = lang || 'en';
|
|
|
|
+
|
|
// render page
|
|
// render page
|
|
const content = await _pageRenderer(tpl, css, pconf);
|
|
const content = await _pageRenderer(tpl, css, pconf);
|
|
|
|
|