feat: Add health check endpoint, SEO meta tags, and sitemap/robots support for improved site visibility and functionality
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1615,6 +1615,47 @@ def default():
|
|||||||
return render_template("main.html")
|
return render_template("main.html")
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/health')
|
||||||
|
def health():
|
||||||
|
return jsonify({"status": "ok", "time": _utc_now_iso()}), 200
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/robots.txt')
|
||||||
|
def robots_txt():
|
||||||
|
path = os.path.join(BASE_DIR, 'static', 'robots.txt')
|
||||||
|
if os.path.exists(path):
|
||||||
|
return send_file(path, mimetype='text/plain')
|
||||||
|
return (
|
||||||
|
"User-agent: *\nDisallow: /admin/\nAllow: /\nSitemap: /sitemap.xml\n",
|
||||||
|
200,
|
||||||
|
{"Content-Type": "text/plain"},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/sitemap.xml')
|
||||||
|
def sitemap_xml():
|
||||||
|
site_root = request.url_root.rstrip('/')
|
||||||
|
sitemap_path = os.path.join(BASE_DIR, 'static', 'sitemap.xml')
|
||||||
|
if os.path.exists(sitemap_path):
|
||||||
|
try:
|
||||||
|
with open(sitemap_path, 'r', encoding='utf-8') as fh:
|
||||||
|
content = fh.read().replace('{{ SITE_ROOT }}', site_root)
|
||||||
|
return app.response_class(content, mimetype='application/xml')
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
xml = (
|
||||||
|
'<?xml version="1.0" encoding="UTF-8"?>\n'
|
||||||
|
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n'
|
||||||
|
' <url>\n'
|
||||||
|
f' <loc>{site_root}</loc>\n'
|
||||||
|
' <changefreq>daily</changefreq>\n'
|
||||||
|
' <priority>1.0</priority>\n'
|
||||||
|
' </url>\n'
|
||||||
|
'</urlset>'
|
||||||
|
)
|
||||||
|
return app.response_class(xml, mimetype='application/xml')
|
||||||
|
|
||||||
|
|
||||||
@app.route('/dienstleistungen')
|
@app.route('/dienstleistungen')
|
||||||
def dienstleistungen():
|
def dienstleistungen():
|
||||||
return render_template("dienstleistungen.html")
|
return render_template("dienstleistungen.html")
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /admin/
|
||||||
|
Disallow: /static/uploads/
|
||||||
|
Allow: /
|
||||||
|
Sitemap: /sitemap.xml
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>{{ SITE_ROOT }}</loc>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
||||||
@@ -8,6 +8,20 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<title>{% block title %}Digitale Schulverwaltung{% endblock %}</title>
|
<title>{% block title %}Digitale Schulverwaltung{% endblock %}</title>
|
||||||
|
{# Basic SEO meta tags, can be overridden per-template by setting `meta_description` #}
|
||||||
|
<meta name="description" content="{{ meta_description|default('Invario — Lehrmittel-, Inventar- und Ausleihverwaltung für Schulen. Sicher, einfach, nachvollziehbar.') }}">
|
||||||
|
<link rel="canonical" href="{{ request.url_root.rstrip('/') }}{{ request.path }}">
|
||||||
|
<!-- OpenGraph / Twitter -->
|
||||||
|
<meta property="og:site_name" content="Invario">
|
||||||
|
<meta property="og:title" content="{% block title %}Digitale Schulverwaltung{% endblock %}">
|
||||||
|
<meta property="og:description" content="{{ meta_description|default('Invario — Lehrmittel-, Inventar- und Ausleihverwaltung für Schulen. Sicher, einfach, nachvollziehbar.') }}">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:url" content="{{ request.url_root.rstrip('/') }}{{ request.path }}">
|
||||||
|
<meta property="og:image" content="{{ url_for('static', filename='images/logo-1.jpeg') }}">
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:title" content="{% block title %}Digitale Schulverwaltung{% endblock %}">
|
||||||
|
<meta name="twitter:description" content="{{ meta_description|default('Invario — Lehrmittel-, Inventar- und Ausleihverwaltung für Schulen. Sicher, einfach, nachvollziehbar.') }}">
|
||||||
|
<meta name="twitter:image" content="{{ url_for('static', filename='images/logo-1.jpeg') }}">
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<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>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{# SEO: per-page description used in base.html meta tags #}
|
||||||
|
{% set meta_description = "Invario bündelt Lehrmittelverwaltung, Inventar und Ausleihe für Schulen – sicher, transparent und einfach zu bedienen." %}
|
||||||
|
|
||||||
{% block title %}Digitale Schulverwaltung mit Sicherheitsfokus{% endblock %}
|
{% block title %}Digitale Schulverwaltung mit Sicherheitsfokus{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
@@ -550,6 +553,21 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<script type="application/ld+json">
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebSite",
|
||||||
|
"name": "Invario",
|
||||||
|
"url": "{{ request.url_root.rstrip('/') }}",
|
||||||
|
"description": "{{ meta_description }}",
|
||||||
|
"publisher": {
|
||||||
|
"@type": "Organization",
|
||||||
|
"name": "Invario",
|
||||||
|
"url": "{{ request.url_root.rstrip('/') }}",
|
||||||
|
"logo": "{{ url_for('static', filename='images/logo-1.jpeg') }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<section class="hero" id="top">
|
<section class="hero" id="top">
|
||||||
<div>
|
<div>
|
||||||
<span class="eyebrow">Lehrmittelverwaltungssoftware für Schulen</span>
|
<span class="eyebrow">Lehrmittelverwaltungssoftware für Schulen</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user