22 lines
1.5 KiB
Markdown
22 lines
1.5 KiB
Markdown
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.
|