From 4ff6f22e25c31d94e454ab88bdb2eba8ae6aec05 Mon Sep 17 00:00:00 2001 From: Ro Date: Tue, 12 May 2020 13:47:50 -0700 Subject: [PATCH] slight tweak so theme activation is drag and drop --- brain/data/Book.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/brain/data/Book.js b/brain/data/Book.js index c745d09..75907ea 100644 --- a/brain/data/Book.js +++ b/brain/data/Book.js @@ -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 => {