From 902c56d00a8662733b0a79fc8c5952ddf7004de8 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 7 Jun 2026 18:57:29 +0800 Subject: fix blog --- pages.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pages.py') diff --git a/pages.py b/pages.py index fcde18e..163b7c7 100644 --- a/pages.py +++ b/pages.py @@ -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 -- cgit v1.2.3