slight tweak so theme activation is drag and drop

This commit is contained in:
Ro 2020-05-12 13:47:50 -07:00
parent 38cfc1fc6c
commit 4ff6f22e25

View file

@ -61,8 +61,10 @@ export default class Pages {
} }
/** /**
* Edits single page based on id and task * Edits single page based on id and task
* @parameter id: id of page being edited * @parameter body: object that contains all page information
* @parameter task: type of task being performed * @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) { editPage(body, id, task, user) {
return new Promise((resolve, reject) => { 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) { publish(theme) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.getPage() this.getPage()
@ -205,7 +211,8 @@ export default class Pages {
let html = md.render(buffed, { html: true, xhtmlOut: true }); let html = md.render(buffed, { html: true, xhtmlOut: true });
let file = pug.renderFile('content/themes/' + theme + '/index.pug', { let file = pug.renderFile('content/themes/' + theme + '/index.pug', {
title: page.metadata.title, title: page.metadata.title,
content: html default_bg: page.metadata.feature,
content_index: html
}); });
fs.writeFile('public/index.html', file, err => { fs.writeFile('public/index.html', file, err => {