css versioniert

This commit is contained in:
hubobel 2026-06-25 16:47:18 +02:00
parent d1c84d0ea9
commit fa1eccb805
2 changed files with 18 additions and 2 deletions

18
app.py
View file

@ -14,6 +14,7 @@ import shutil
from shutil import copy2
import logging
import platform
import os
# --------------------------------------------------
# Logging
# --------------------------------------------------
@ -407,9 +408,23 @@ def get_balance_comparison():
result_data[names[idx]] = data
return result_data
@app.context_processor
def inject_css_version():
return {
"css_version": int(
os.path.getmtime(
BASE_DIR / "static" / "style.css"
)
)
}
@app.route("/")
def index():
css_version = int(
os.path.getmtime(
BASE_DIR / "static" / "style.css"
)
)
(
year,
week,
@ -446,6 +461,7 @@ def index():
total_expenses=total_expenses,
total_saldo=total_saldo,
balance=balance,
css_version=css_version,
balance_color=balance_color,
current_day=current_day,
balance_history=balance_history

View file

@ -12,7 +12,7 @@
</title>
<link rel="stylesheet"
href="{{ url_for('static', filename='style.css') }}">
href="{{ url_for('static', filename='style.css') }}?v={{ css_version }}">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>