From b0a73a99b9df53739b0faa4d2b8f310673bdc18e Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 17 Jun 2020 20:20:28 -0700 Subject: [PATCH] Add ability to populate the content area in the page with a markdown file --- webroot/index.html | 2 +- webroot/js/app.js | 14 +++++++++++++- webroot/static/content.md | 4 ++++ webroot/styles/layout.css | 9 +++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 webroot/static/content.md diff --git a/webroot/index.html b/webroot/index.html index ca37ab3d6..6431740d4 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -11,7 +11,7 @@ - + diff --git a/webroot/js/app.js b/webroot/js/app.js index 4157256b4..33c86a94a 100644 --- a/webroot/js/app.js +++ b/webroot/js/app.js @@ -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; diff --git a/webroot/static/content.md b/webroot/static/content.md new file mode 100644 index 000000000..6b8f2888b --- /dev/null +++ b/webroot/static/content.md @@ -0,0 +1,4 @@ +# Stream description and content can go here. + +1. Edit `content.md` in markdown. +1. And it'll go here. \ No newline at end of file diff --git a/webroot/styles/layout.css b/webroot/styles/layout.css index 5407aff7c..ab82b1694 100644 --- a/webroot/styles/layout.css +++ b/webroot/styles/layout.css @@ -407,3 +407,12 @@ header h1 { display: none; } } + +/* Tailwind sets list styles to none. I don't know why. */ +ol { + list-style: decimal; +} + +ul { + list-style: unset; +}