Add ability to populate the content area in the page with a markdown file

This commit is contained in:
Gabe Kangas
2020-06-17 20:20:28 -07:00
parent 0cb2ab396c
commit b0a73a99b9
4 changed files with 27 additions and 2 deletions

View File

@@ -25,8 +25,20 @@ async function setupApp() {
appMessagingMisc.init();
const config = await new Config().init();
app.description = autoLink(config.description, { embed: false });
app.title = config.title;
const configFileLocation = "./js/config.json";
try {
const pageContentFile = "/static/content.md"
const response = await fetch(pageContentFile);
const descriptionMarkdown = await response.text()
const descriptionHTML = new showdown.Converter().makeHtml(descriptionMarkdown);
app.description = descriptionHTML;
return this;
} catch (error) {
console.log(error);
}
}
var websocketReconnectTimer;