[Jinja2] init

This commit is contained in:
coja
2026-05-02 23:18:51 +02:00
parent 9eca59f80f
commit 0724816c88
13 changed files with 350 additions and 352 deletions

21
todo.md Normal file
View File

@@ -0,0 +1,21 @@
1. High Impact: Reliability & Security
* Adopt a Templating Engine (e.g., Jinja2):
* Problem: The current build scripts (build_pages.py, prep.py) use manual string replacement (e.g., .replace('<!--TITLE-->', ...)). This is brittle and prone to errors as the site grows.
* Benefit: Using Jinja2 would make templates much more powerful (loops, conditionals) and, crucially, would prevent XSS vulnerabilities by automatically escaping data from your CSV files.
* Use csv.DictReader in Python:
* Problem: prep.py accesses CSV columns by index (e.g., row[0]). If you add a column to dogadjaji.csv, the build will break.
* Benefit: Accessing by name (row['title']) makes the code resilient to data schema changes.
2. Medium Impact: Developer Experience (DX)
* Code Linting:
* Benefit: Adding black or flake8 for Python and prettier for HTML/CSS would ensure consistent style across the repository.
3. Low Impact: Performance & Modernization
* CSS Consolidation:
* Problem: There are many small CSS files (one per page).
* Benefit: While fine for a small site, consolidating these or using a preprocessor like Sass would make managing global styles easier.
* Asset Optimization:
* Benefit: Implementing automated image compression (for the event posters) would reduce the final site payload.
Which of these areas would you like me to focus on first? I recommend starting with the Jinja2 migration as it solves both maintainability and security issues.