Add static website for Sonjas Rasselbande
- src/: layout, page fragments, CSS design system, vanilla JS, .htaccess, service worker, manifest, SVG artwork - scripts/: python build (no npm), HTML/link checks, image + photo pipeline, FTP deploy with size verification - docs/: analysis of the old Wix site, architecture notes, deployment learnings (FollowSymLinks 500, FTPS data channel, Let's Encrypt), open items, source material - site/ is generated (make build) and gitignored
This commit is contained in:
commit
2c7cae11a5
74 changed files with 3491 additions and 0 deletions
261
scripts/build.py
Executable file
261
scripts/build.py
Executable file
|
|
@ -0,0 +1,261 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Statischer Site-Generator für sonjasrasselbande.de
|
||||
|
||||
Kein npm, keine Abhängigkeiten – nur Python 3 (stdlib).
|
||||
Layout + Seitenfragmente aus src/ werden zu fertigen HTML-Dateien in site/
|
||||
zusammengesetzt; Assets werden kopiert, sitemap.xml wird erzeugt.
|
||||
|
||||
Aufruf:
|
||||
python3 scripts/build.py # baut site/
|
||||
python3 scripts/build.py --clean # baut site/ komplett neu
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime as dt
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
SRC = ROOT / "src"
|
||||
OUT = ROOT / "site"
|
||||
|
||||
BASE_URL = "https://sonjasrasselbande.de/"
|
||||
SITE_NAME = "Sonjas Rasselbande"
|
||||
|
||||
# slug, Navigationslabel (None = nicht in der Navigation), <title>, description,
|
||||
# robots, indexierbar/in Sitemap
|
||||
PAGES: list[dict] = [
|
||||
{
|
||||
"slug": "index",
|
||||
"nav": "Start",
|
||||
"title": "Sonjas Rasselbande – Kindertagespflege & Tagesmutter in Neuss-Rosellen",
|
||||
"description": "Kindertagespflege in Neuss-Rosellen: Tagesmutter Sonja Schmitz betreut bis zu fünf Kinder von 6 Monaten bis 3 Jahren – kleine Gruppe, frische Mahlzeiten, individuelle Eingewöhnung.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "1.0",
|
||||
},
|
||||
{
|
||||
"slug": "ueber-mich",
|
||||
"nav": "Das bin ich",
|
||||
"title": "Das bin ich – Sonja Schmitz, Tagesmutter in Neuss | Sonjas Rasselbande",
|
||||
"description": "Sonja Schmitz ist seit 2009 qualifizierte Tagesmutter in Neuss-Rosellen: Pflegeerlaubnis seit 2008, regelmäßige Fortbildungen und eine enge Zusammenarbeit mit dem Jugendamt.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.8",
|
||||
},
|
||||
{
|
||||
"slug": "konzept",
|
||||
"nav": "Konzept",
|
||||
"title": "Pädagogisches Konzept – Kindertagespflege Neuss | Sonjas Rasselbande",
|
||||
"description": "Bildungsfelder, Sicherheit, Hygiene, Ernährung, Eingewöhnung und Tagesablauf: das pädagogische Konzept der Kindertagespflege Sonjas Rasselbande in Neuss-Rosellen.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.9",
|
||||
},
|
||||
{
|
||||
"slug": "gruppe",
|
||||
"nav": "Gruppe",
|
||||
"title": "Unsere kleine Gruppe & Räume – Kindertagespflege Neuss | Sonjas Rasselbande",
|
||||
"description": "Fünf Kinder von 6 Monaten bis 3 Jahren, altersgemischte Gruppe und kindgerechte Räume mit Wickelbereich, Schlafbereich und Küche in Neuss-Rosellen.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.8",
|
||||
},
|
||||
{
|
||||
"slug": "kosten",
|
||||
"nav": "Kosten",
|
||||
"title": "Kosten & Vertrag – Betreuungskosten über das Jugendamt | Sonjas Rasselbande",
|
||||
"description": "Wie setzen sich die Betreuungskosten in der Kindertagespflege zusammen? Einkommensabhängige Beiträge, Kostenträger Jugendamt und die nächsten Schritte bis zum Betreuungsplatz.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.8",
|
||||
},
|
||||
{
|
||||
"slug": "kontakt",
|
||||
"nav": "Kontakt",
|
||||
"title": "Kontakt & Anfahrt – Neuss-Rosellen | Sonjas Rasselbande",
|
||||
"description": "Kontakt zur Kindertagespflege Sonjas Rasselbande: Rosellener Schulstraße 2 in 41470 Neuss-Rosellen, Telefon 0173 70 220 20, sonja.schmitz79@gmx.de. Besuch gerne nach Terminabsprache.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.9",
|
||||
},
|
||||
{
|
||||
"slug": "impressum",
|
||||
"nav": None,
|
||||
"title": "Impressum | Sonjas Rasselbande",
|
||||
"description": "Impressum der Kindertagespflege Sonjas Rasselbande, Sonja Schmitz, Neuss-Rosellen.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.2",
|
||||
},
|
||||
{
|
||||
"slug": "datenschutz",
|
||||
"nav": None,
|
||||
"title": "Datenschutzerklärung | Sonjas Rasselbande",
|
||||
"description": "Datenschutzerklärung der Website sonjasrasselbande.de: datensparsam, ohne Analyse-Cookies und ohne externe Schriftarten.",
|
||||
"robots": "index,follow",
|
||||
"in_sitemap": True,
|
||||
"priority": "0.2",
|
||||
},
|
||||
{
|
||||
"slug": "404",
|
||||
"nav": None,
|
||||
"title": "Seite nicht gefunden | Sonjas Rasselbande",
|
||||
"description": "Diese Seite existiert nicht. Weiter zur Startseite der Kindertagespflege Sonjas Rasselbande.",
|
||||
"robots": "noindex,follow",
|
||||
"in_sitemap": False,
|
||||
},
|
||||
{
|
||||
"slug": "offline",
|
||||
"nav": None,
|
||||
"title": "Offline | Sonjas Rasselbande",
|
||||
"description": "Sie sind offline. Diese Seite ist nicht im Zwischenspeicher vorhanden.",
|
||||
"robots": "noindex,nofollow",
|
||||
"in_sitemap": False,
|
||||
},
|
||||
]
|
||||
|
||||
JSONLD_HOME = """ <script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "ChildCare",
|
||||
"name": "Sonjas Rasselbande",
|
||||
"alternateName": "Kindertagespflege Sonja Schmitz",
|
||||
"description": "Kindertagespflege in Neuss-Rosellen: Betreuung von bis zu fünf Kindern im Alter von 6 Monaten bis 3 Jahren durch eine qualifizierte Tagesmutter.",
|
||||
"url": "https://sonjasrasselbande.de/",
|
||||
"telephone": "+49 173 7022020",
|
||||
"email": "sonja.schmitz79@gmx.de",
|
||||
"founder": { "@type": "Person", "name": "Sonja Schmitz" },
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
"streetAddress": "Rosellener Schulstraße 2",
|
||||
"postalCode": "41470",
|
||||
"addressLocality": "Neuss",
|
||||
"addressRegion": "Nordrhein-Westfalen",
|
||||
"addressCountry": "DE"
|
||||
},
|
||||
"areaServed": { "@type": "City", "name": "Neuss" },
|
||||
"knowsLanguage": "de",
|
||||
"maximumAttendeeCapacity": 5,
|
||||
"keywords": "Tagesmutter Neuss, Kindertagespflege Rosellen, Kinderbetreuung unter 3 Jahren, Betreuungsplatz Neuss"
|
||||
}
|
||||
</script>"""
|
||||
|
||||
|
||||
def nav_html(active_slug: str) -> str:
|
||||
out = []
|
||||
for page in PAGES:
|
||||
if not page["nav"]:
|
||||
continue
|
||||
current = ' aria-current="page"' if page["slug"] == active_slug else ""
|
||||
href = "index.html" if page["slug"] == "index" else f"{page['slug']}.html"
|
||||
out.append(f' <li><a class="nav__link" href="{href}"{current}>{page["nav"]}</a></li>')
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
def render(page: dict, layout: str) -> str:
|
||||
slug = page["slug"]
|
||||
html_file = "index.html" if slug == "index" else f"{slug}.html"
|
||||
fragment = (SRC / "pages" / f"{slug}.html").read_text(encoding="utf-8").rstrip() + "\n"
|
||||
|
||||
preload_hero = ""
|
||||
if slug == "index":
|
||||
preload_hero = (
|
||||
' <link rel="preload" href="assets/img/portrait-sonja-308.avif" '
|
||||
'as="image" type="image/avif" fetchpriority="high">'
|
||||
)
|
||||
|
||||
html = layout
|
||||
replacements = {
|
||||
"{{title}}": page["title"],
|
||||
"{{description}}": page["description"],
|
||||
"{{robots}}": page["robots"],
|
||||
"{{canonical}}": f"{BASE_URL}{'' if slug == 'index' else html_file}",
|
||||
"{{base_url}}": BASE_URL,
|
||||
"{{prefix}}": "",
|
||||
"{{nav}}": nav_html(slug),
|
||||
"{{content}}": fragment,
|
||||
"{{preload_hero}}": preload_hero,
|
||||
"{{jsonld}}": JSONLD_HOME if slug == "index" else "",
|
||||
}
|
||||
for key, value in replacements.items():
|
||||
html = html.replace(key, value)
|
||||
|
||||
leftovers = [k for k in ("{{", ) if k in html]
|
||||
if leftovers:
|
||||
raise SystemExit(f"Platzhalter nicht ersetzt in {html_file}: {html[-400:]}")
|
||||
return html
|
||||
|
||||
|
||||
def build_sitemap(pages: list[dict]) -> str:
|
||||
today = dt.date.today().isoformat()
|
||||
urls = []
|
||||
for page in pages:
|
||||
if not page["in_sitemap"]:
|
||||
continue
|
||||
loc = BASE_URL if page["slug"] == "index" else f"{BASE_URL}{page['slug']}.html"
|
||||
urls.append(
|
||||
" <url>\n"
|
||||
f" <loc>{loc}</loc>\n"
|
||||
f" <lastmod>{today}</lastmod>\n"
|
||||
" <changefreq>monthly</changefreq>\n"
|
||||
f" <priority>{page['priority']}</priority>\n"
|
||||
" </url>"
|
||||
)
|
||||
return (
|
||||
'<?xml version="1.0" encoding="UTF-8"?>\n'
|
||||
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n'
|
||||
+ "\n".join(urls)
|
||||
+ "\n</urlset>\n"
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
layout = (SRC / "layout.html").read_text(encoding="utf-8")
|
||||
|
||||
if "--clean" in sys.argv and OUT.exists():
|
||||
shutil.rmtree(OUT)
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
for page in PAGES:
|
||||
html = render(page, layout)
|
||||
name = "index.html" if page["slug"] == "index" else f"{page['slug']}.html"
|
||||
(OUT / name).write_text(html, encoding="utf-8")
|
||||
print(f" ✓ {name}")
|
||||
|
||||
# Assets & statische Dateien
|
||||
for item in ("assets", "manifest.webmanifest", "sw.js", "robots.txt", ".htaccess"):
|
||||
src = SRC / item
|
||||
dst = OUT / item
|
||||
if not src.exists():
|
||||
print(f" ! fehlt: src/{item}")
|
||||
continue
|
||||
if src.is_dir():
|
||||
if dst.exists():
|
||||
shutil.rmtree(dst)
|
||||
shutil.copytree(src, dst)
|
||||
# Original-Fotos nicht mit ausliefern (nur die generierten Varianten)
|
||||
originals = dst / "img" / "originals"
|
||||
if originals.exists():
|
||||
shutil.rmtree(originals)
|
||||
else:
|
||||
shutil.copy2(src, dst)
|
||||
print(" ✓ assets/, manifest.webmanifest, sw.js, robots.txt, .htaccess")
|
||||
|
||||
(OUT / "sitemap.xml").write_text(build_sitemap(PAGES), encoding="utf-8")
|
||||
print(" ✓ sitemap.xml")
|
||||
|
||||
# favicon.ico zusätzlich ins Root (Alt-Browser und Crawler fragen /favicon.ico an)
|
||||
ico = SRC / "assets" / "img" / "favicon.ico"
|
||||
if ico.exists():
|
||||
shutil.copy2(ico, OUT / "favicon.ico")
|
||||
print(" ✓ favicon.ico (Root)")
|
||||
|
||||
total = sum(1 for _ in OUT.rglob("*") if _.is_file())
|
||||
print(f"\nFertig: {total} Dateien in {OUT.relative_to(ROOT)}/")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue