SEO: Crawl- und Reputationsgrundlage für die neue Domain
- docs/seo-und-reputation.md: Ist-Zustand, DNS-Records (DMARC/CAA/DNSSEC, SPF -all), Einreich-Adressen für Firewall-Kategorien, Backlink-Reihenfolge - build.py: Verification-Meta-Tokens (Google/Bing), IndexNow-Key-Datei, JSON-LD als @graph (ChildCare + WebSite) plus BreadcrumbList je Unterseite, lastmod der Sitemap aus dem Git-Commit der Seitenquelle - layout.html: Platzhalter für Verification-Meta-Tags - .htaccess: Trailing Slash per 301 auf die kanonische URL - deploy.sh: IndexNow-Ping nach erfolgreichem Upload (nicht blockierend) - check.py: validiert JSON-LD und Sitemap-Einträge
This commit is contained in:
parent
2c7cae11a5
commit
edc7f0b863
9 changed files with 411 additions and 28 deletions
|
|
@ -7,6 +7,7 @@ Exit-Code 1, wenn Probleme gefunden wurden – so auch in CI nutzbar.
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
|
@ -81,6 +82,15 @@ def main() -> int:
|
|||
if html.count("<h1") != 1:
|
||||
problems.append(f"{page.name}: {html.count('<h1')}× <h1> (erwartet: 1)")
|
||||
|
||||
for match in re.finditer(r'<script type="application/ld\+json">(.*?)</script>', html, re.S):
|
||||
try:
|
||||
data = json.loads(match.group(1))
|
||||
except json.JSONDecodeError as exc:
|
||||
problems.append(f"{page.name}: ungültiges JSON-LD ({exc})")
|
||||
continue
|
||||
if not data.get("@type") and not data.get("@graph"):
|
||||
problems.append(f"{page.name}: JSON-LD ohne @type/@graph")
|
||||
|
||||
for match in re.finditer(r'(?:href|src)="([^"#][^"]*)"', html):
|
||||
target = match.group(1)
|
||||
if target.startswith(("http://", "https://", "mailto:", "tel:", "data:")):
|
||||
|
|
@ -93,6 +103,18 @@ def main() -> int:
|
|||
if "alt=" not in tag:
|
||||
problems.append(f"{page.name}: <img> ohne alt – {tag[:60]}")
|
||||
|
||||
# Sitemap gegen die gebauten Dateien prüfen (Crawlbarkeit)
|
||||
sitemap = (SITE / "sitemap.xml").read_text(encoding="utf-8")
|
||||
locs = re.findall(r"<loc>(.*?)</loc>", sitemap)
|
||||
if not locs:
|
||||
problems.append("sitemap.xml enthält keine <loc>-Einträge")
|
||||
for loc in locs:
|
||||
rel = loc.split("sonjasrasselbande.de/", 1)[-1] or "index.html"
|
||||
if not (SITE / rel).exists():
|
||||
problems.append(f"sitemap.xml: Eintrag ohne Datei – {loc}")
|
||||
if "Sitemap:" not in (SITE / "robots.txt").read_text(encoding="utf-8"):
|
||||
problems.append("robots.txt verweist nicht auf die Sitemap")
|
||||
|
||||
total_kb = sum(f.stat().st_size for f in SITE.rglob("*") if f.is_file()) / 1024
|
||||
print(f"{len(pages)} Seiten geprüft, {total_kb:.0f} KB gesamt")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue