diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-06-07 18:57:29 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-06-07 18:57:29 +0800 |
| commit | 902c56d00a8662733b0a79fc8c5952ddf7004de8 (patch) | |
| tree | eccafd8f15a4f5632c6a9f3ee3e1cc2e8faa58dd /pages.py | |
| parent | 5cd9f8c27d069e83058400289fcae17cd96c777c (diff) | |
fix blog
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 |
