[Jinja2] lang btn and cleanup
This commit is contained in:
@@ -56,10 +56,3 @@ def main():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<img src="/img/logo-light.svg" alt="Logo" /> Decentrala
|
<img src="/img/logo-light.svg" alt="Logo" /> Decentrala
|
||||||
</a>
|
</a>
|
||||||
<button id="theme-switcher"></button>
|
<button id="theme-switcher"></button>
|
||||||
<a class="lang" hreflang="sr" href="/en/deconference">SR</a>
|
<a class="lang" hreflang="en" href="/en/index">EN</a>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,28 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="{{ lang }}">
|
<html lang="{{ lang }}">
|
||||||
<head>
|
<head>
|
||||||
|
<!--
|
||||||
|
*@@*
|
||||||
|
*@@@@*
|
||||||
|
*@@*
|
||||||
|
||
|
||||||
|
||
|
||||||
|
*@@* *@@* *@@*
|
||||||
|
*@@@@*===*@@@@*===*@@@@*
|
||||||
|
*@@* *@@* *@@*
|
||||||
|
|| //
|
||||||
|
|| //
|
||||||
|
*@@*//
|
||||||
|
*@@@@*
|
||||||
|
*@@*
|
||||||
|
|
||||||
|
____ _____ ____ _____ _ _ _____ ____ _ _ _
|
||||||
|
| _ \| ____/ ___| ____| \ | |_ _| _ \ / \ | | / \
|
||||||
|
| | | | _|| | | _| | \| | | | | |_) | / _ \ | | / _ \
|
||||||
|
| |_| | |__| |___| |___| |\ | | | | _ < / ___ \| |___ / ___ \
|
||||||
|
|____/|_____\____|_____|_| \_| |_| |_| \_\/_/ \_\_____/_/ \_\
|
||||||
|
-->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
const theme = localStorage.getItem("theme");
|
const theme = localStorage.getItem("theme");
|
||||||
@@ -28,7 +50,7 @@
|
|||||||
<img src="/img/logo-{{ 'dark' if is_dark else 'light' }}.svg" alt="Logo" /> Decentrala
|
<img src="/img/logo-{{ 'dark' if is_dark else 'light' }}.svg" alt="Logo" /> Decentrala
|
||||||
</a>
|
</a>
|
||||||
<button id="theme-switcher"></button>
|
<button id="theme-switcher"></button>
|
||||||
<a class="lang" hreflang="sr" href="{{ sr_link }}">SR</a>
|
<a class="lang" hreflang="{{ 'sr' if lang == 'en' else 'en' }}" href="{{ '/en/' if lang == 'sr' else '/' }}{{ 'index' if lang == 'sr' else '' }}{{ 'index' if lang == 'en' else '' }}">{{ 'SR' if lang == 'en' else 'EN' }}</a>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|||||||
21
todo.md
21
todo.md
@@ -1,21 +0,0 @@
|
|||||||
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.
|
|
||||||
Reference in New Issue
Block a user