diff options
Diffstat (limited to 'pages.py')
| -rw-r--r-- | pages.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -24,6 +24,7 @@ BLOGPOST_INDEX = {} EVENT_INDEX = {} VIDEO_INDEX = {} +# ## INITIALISATION ## # with open(PATH_HTML_PROJECT_TEMPLATE) as f: HTML_PROJECT_TEMPLATE = f.read() @@ -43,6 +44,19 @@ with open(PATH_EVENT_INDEX) as f: with open(PATH_VIDEO_INDEX) as f: VIDEO_INDEX = json.load(f) +for idx in range(len(BLOGPOST_INDEX["posts"])): + metadata_json = BLOGPOST_INDEX["posts"][idx] + + with open("." + metadata_json["path"], "r") as f: + source = f.read() + + metadata, _ = markdown_renderer.md_to_html(source) + BLOGPOST_INDEX["posts"][idx] = BLOGPOST_INDEX["posts"][idx] | metadata + + print(BLOGPOST_INDEX) + +# #### # + def render_project_details(project_name: str) -> tuple: html = HTML_PROJECT_TEMPLATE |
