SEO-Metatags & sitemap.xml hinzugefügt

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-23 12:47:21 +01:00
parent e663b9ccee
commit 991e250f53
2 changed files with 26 additions and 0 deletions

17
app.py
View File

@@ -99,6 +99,22 @@ def calendar_ics() -> Response:
) )
@app.route("/sitemap.xml")
def sitemap() -> Response:
"""Einfache Sitemap mit den wichtigsten URLs der Anwendung."""
base = PUBLIC_URL or request.url_root.rstrip("/")
urls = [f"{base}/", f"{base}/calendar.ics"]
body = [
'<?xml version="1.0" encoding="UTF-8"?>',
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
]
for u in urls:
body.append(f" <url><loc>{u}</loc></url>")
body.append("</urlset>")
xml = "\n".join(body) + "\n"
return Response(xml, mimetype="application/xml")
def _format_last_refresh() -> str | None: def _format_last_refresh() -> str | None:
"""Zeitpunkt der letzten Aktualisierung formatiert (z. B. 29.01.2025, 14:32 Uhr).""" """Zeitpunkt der letzten Aktualisierung formatiert (z. B. 29.01.2025, 14:32 Uhr)."""
with _cache_lock: with _cache_lock:
@@ -136,6 +152,7 @@ def index():
calendar_url=calendar_url, calendar_url=calendar_url,
last_refresh_str=last_refresh_str, last_refresh_str=last_refresh_str,
upcoming_days=upcoming_days, upcoming_days=upcoming_days,
base_url=base,
) )
except Exception as e: except Exception as e:
_log.exception("Template index.html: %s", e) _log.exception("Template index.html: %s", e)

View File

@@ -4,6 +4,15 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Speiseplan Kantine BHZ Kiel-Wik iCal-Abo</title> <title>Speiseplan Kantine BHZ Kiel-Wik iCal-Abo</title>
<meta name="description" content="Aktueller Speiseplan der Kantine im Behördenzentrum Kiel-Wik als iCal-Abo und übersichtliche Kacheln für kommende Tage.">
<meta name="author" content="Markus F.J. Busche">
<meta name="robots" content="index,follow">
<link rel="canonical" href="{{ base_url }}/">
<meta property="og:locale" content="de_DE">
<meta property="og:type" content="website">
<meta property="og:title" content="Speiseplan Kantine BHZ Kiel-Wik iCal-Abo">
<meta property="og:description" content="Aktueller Speiseplan der Kantine im Behördenzentrum Kiel-Wik als abonnierbarer Kalender und als übersichtliche Kachelansicht für kommende Tage.">
<meta property="og:url" content="{{ base_url }}/">
<link rel="icon" href="{{ url_for('static', filename='favicon.png') }}" type="image/png"> <link rel="icon" href="{{ url_for('static', filename='favicon.png') }}" type="image/png">
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>