summaryrefslogtreecommitdiff
path: root/pages.py
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2026-06-07 18:57:29 +0800
committeraltaf-creator <dev@altafcreator.com>2026-06-07 18:57:29 +0800
commit902c56d00a8662733b0a79fc8c5952ddf7004de8 (patch)
treeeccafd8f15a4f5632c6a9f3ee3e1cc2e8faa58dd /pages.py
parent5cd9f8c27d069e83058400289fcae17cd96c777c (diff)
fix blog
Diffstat (limited to 'pages.py')
-rw-r--r--pages.py14
1 files changed, 14 insertions, 0 deletions
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