Add noindex pages, robots.txt and operator footer

- Page.noindex: marked pages get a robots meta tag and a Disallow line in the
  generated robots.txt (single source of truth in src/pages.py)
- templates/robots.txt: public pages indexable, noindex pages and data files not
- Footer shows an optional operator line from contents/snippets/footer_operator.md
- Tests for robots.txt, noindex meta and footer

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-10-10 15:33:37 +02:00
co-authored by Claude Sonnet 5.5
parent 874838f525
commit 81edf08d8e
5 changed files with 89 additions and 6 deletions
+4 -2
View File
@@ -4,6 +4,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>50Ω – lär dig amatörradio</title>
{% if robots %}
<meta name="robots" content="{{ robots }}">
{% endif %}
{% if social_image %}
<meta property="og:type" content="website">
<meta property="og:site_name" content="50Ω">
@@ -153,8 +156,7 @@
Inte godkänd av DARC eller SSA.
</div>
<div class="fiftyohm-footer-links d-flex gap-2">
{# TODO: The operator must add their own imprint / contact details and privacy information here. #}
<span class="text-secondary">[Utgivare, kontakt och integritetspolicy &ndash; ska fyllas i av driftansvarig]</span>
{% if footer_operator %}<span class="text-secondary">{{ footer_operator }}</span>{% endif %}
</div>
</div>
</div>
+11
View File
@@ -0,0 +1,11 @@
# robots.txt – generated by the site generator, do not edit by hand.
# The course pages may be crawled and indexed. Pages with contact details may not.
User-agent: *
Allow: /
{% for page in noindex_pages -%}
Disallow: /{{ page }}
{% endfor -%}
# Data files (search indexes etc.) are not pages
Disallow: /*.json$
Disallow: /*.zip$