From acc9710991975f8718914120b5f63da86cdb9397 Mon Sep 17 00:00:00 2001 From: m Date: Sun, 22 Mar 2026 09:21:50 +0100 Subject: [PATCH] logic path --- flask_logic/logic.py | 12 +++++++++--- readme.md | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/flask_logic/logic.py b/flask_logic/logic.py index 77db759..a2b1329 100644 --- a/flask_logic/logic.py +++ b/flask_logic/logic.py @@ -48,14 +48,20 @@ def load_snippet(filename): def get_enriched_post(post_id, BLOG_POSTS): post = next((p for p in BLOG_POSTS if p.get('id') == post_id), None) - if not post: - return None + from pathlib import Path + + BASE_DIR = Path(__file__).resolve().parent.parent + DATA_DIR = BASE_DIR / "content" / "data" + + file_path_10 = DATA_DIR / "post_10_timeline.html" + + # Mapping config: keeps logic.py tiny configs = { 10: { "template": "components/timeline.html", - "timeline_file": "post_10_timeline.html" + "timeline_file": file_path_10 }, 8: { "template": "components/christmas_post.html", diff --git a/readme.md b/readme.md index ba66d5b..2471df7 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,8 @@ A minimal **Flask template set** for my blog. This project adapts and the original [simple-blog-template](https://github.com/earlbread/simple-blog-template) by [Seunghun Lee](https://github.com/earlbread). +Content is **static**; selected templates (with **fixed** names/paths) are loaded dynamically. +Initially deployed using uWSGI and Nginx; later migrated to Gunicorn, Caddy, and Docker. Most versions should work. ## Git Tag