|
|
|
@ -61,8 +61,10 @@ export default class Pages {
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Edits single page based on id and task
|
|
|
|
|
* @parameter id: id of page being edited
|
|
|
|
|
* @parameter task: type of task being performed
|
|
|
|
|
* @parameter body: object that contains all page information
|
|
|
|
|
* @parameter id: identifier for page being edited
|
|
|
|
|
* @parameter task: type of task being performed - listed in DataEvents Class
|
|
|
|
|
* @parameter user: object containin user information
|
|
|
|
|
*/
|
|
|
|
|
editPage(body, id, task, user) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
@ -177,6 +179,10 @@ export default class Pages {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Renders all pages from markdown to html
|
|
|
|
|
* @parameter theme: current theme being used as defined in settings
|
|
|
|
|
*/
|
|
|
|
|
publish(theme) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
this.getPage()
|
|
|
|
@ -205,7 +211,8 @@ export default class Pages {
|
|
|
|
|
let html = md.render(buffed, { html: true, xhtmlOut: true });
|
|
|
|
|
let file = pug.renderFile('content/themes/' + theme + '/index.pug', {
|
|
|
|
|
title: page.metadata.title,
|
|
|
|
|
content: html
|
|
|
|
|
default_bg: page.metadata.feature,
|
|
|
|
|
content_index: html
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fs.writeFile('public/index.html', file, err => {
|
|
|
|
|