Files
Orchestrator/privat/CV/andreknie.de/scripts/list-all-posts.py
ankn b46de6dc7d
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
ci: migrate GitHub actions to Gitea actions
2026-07-22 15:42:06 +02:00

18 lines
524 B
Python

import os
import re
POSTS_DIR = "content/posts"
post_files = sorted([f for f in os.listdir(POSTS_DIR) if f.endswith(".md")])
for pf in post_files:
with open(os.path.join(POSTS_DIR, pf), 'r', encoding='utf-8') as f:
content = f.read()
title_m = re.search(r'^title:\s*"?(.+?)"?$', content, re.M)
date_m = re.search(r'^date:\s*(.+)$', content, re.M)
title = title_m.group(1) if title_m else ""
date = date_m.group(1) if date_m else ""
print(f"[{pf}] Date: {date} | Title: {title}")