logic path
This commit is contained in:
@@ -48,14 +48,20 @@ def load_snippet(filename):
|
|||||||
|
|
||||||
def get_enriched_post(post_id, BLOG_POSTS):
|
def get_enriched_post(post_id, BLOG_POSTS):
|
||||||
post = next((p for p in BLOG_POSTS if p.get('id') == post_id), None)
|
post = next((p for p in BLOG_POSTS if p.get('id') == post_id), None)
|
||||||
if not post:
|
from pathlib import Path
|
||||||
return None
|
|
||||||
|
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
|
# Mapping config: keeps logic.py tiny
|
||||||
configs = {
|
configs = {
|
||||||
10: {
|
10: {
|
||||||
"template": "components/timeline.html",
|
"template": "components/timeline.html",
|
||||||
"timeline_file": "post_10_timeline.html"
|
"timeline_file": file_path_10
|
||||||
},
|
},
|
||||||
8: {
|
8: {
|
||||||
"template": "components/christmas_post.html",
|
"template": "components/christmas_post.html",
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
A minimal **Flask template set** for my blog.
|
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).
|
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
|
## Git Tag
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user