Skip to content

feat: real pre-rendered pages for all 161 anchors (EN + 155 DE) — no more 404s#598

Merged
rdmueller merged 2 commits into
LLM-Coding:mainfrom
raifdmueller:feat/597-static-anchor-pages
Jun 10, 2026
Merged

feat: real pre-rendered pages for all 161 anchors (EN + 155 DE) — no more 404s#598
rdmueller merged 2 commits into
LLM-Coding:mainfrom
raifdmueller:feat/597-static-anchor-pages

Conversation

@raifdmueller

@raifdmueller raifdmueller commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #597

What

Every /anchor/<id> URL returned HTTP 404 (SPA-fallback only) while sitemap.xml and the DefinedTerm JSON-LD (#579) advertised all 161 of them. Each anchor now gets a real pre-rendered page — and a German variant where a translation exists.

Changes

  1. Fragments (render-docs.js): every docs/anchors/*.adoc (161 EN + 155 DE) renders to website/public/docs/anchors/<id>(.de).html at prebuild — one summary log line, adds ~2s to the build.
  2. Pages (prerender-routes.js): dist/anchor/<id>/index.html + dist/de/anchor/<id>/index.html via the writeRouteVariant()/applyHead() machinery from fix: make the website navigable and readable without JavaScript (EN + DE) #596 — per-anchor <title>, meta description (via extractDescription() reused from generate-jsonld.js, now exported; generic fallback), self-canonical, honest hreflang pairs, lang="de" on German pages. The [%collapsible] anchor body is expanded (<details open>) so the static page shows its content without a click.
  3. Home catalog links each anchor to its real page (/anchor/<id>; German catalog → /de/anchor/<id> where available) instead of /all-anchors#<id>.
  4. Sitemap: the existing 161 /anchor/<id> entries become valid 200s; 155 /de/anchor/<id> entries added (339 URLs total).
  5. v0.6.0 + changelog.

No SPA change needed: the router from #596 already resolves /de/anchor/<id>; with JS the page boots into home + anchor modal exactly as before (verified, no page errors). The DefinedTerm JSON-LD URLs become honest without modification.

Verification

  • Full build: 161 anchor pages (+ 155 German variants) pre-rendered, build stays ~5s.
  • No-JS (Playwright, javaScriptEnabled: false): /anchor/mece/ shows title, expanded Core Concepts, header nav; /de/anchor/mece/ is lang="de" German.
  • With JS: modal opens over home on the same URL, no console/page errors.
  • 102 unit tests, 35 E2E tests, ESLint + Prettier (website + scripts) green.

Note for review

anchors.json entries without an .adoc file are skipped with a warning (currently none). The pre-existing SPA behavior of rewriting the document title to a de-kebab-cased id ("Mece — Semantic Anchors") on hydration is unchanged — could be polished separately by using the real anchor title.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Anchor-Detailseiten sind jetzt echte, vorkonfigurierte Seiten mit vollständigen SEO-Metadaten (Titel, Beschreibung, kanonische URL)
    • Deutsche Varianten für Anchor-URLs (/de/anchor/) verfügbar
    • Homepage-Katalog verlinkt direkt auf neue Anchor-Detailseiten
  • Documentation

    • Changelog für Version 0.6.0 aktualisiert

raifdmueller and others added 2 commits June 10, 2026 23:05
render-docs.js renders each docs/anchors/*.adoc (161 EN + 155 DE) to a
fragment; prerender-routes.js writes dist/anchor/<id>/index.html and
dist/de/anchor/<id>/index.html with per-anchor title, meta description
(reusing extractDescription from generate-jsonld.js, now exported),
self-canonical URL and hreflang pairs. The [%collapsible] anchor body is
expanded on the static page. The static home catalog links to these
pages; the sitemap adds the 155 German variants. Fixes the 161 HTTP-404
URLs that sitemap.xml and the DefinedTerm JSON-LD were advertising.

Refs LLM-Coding#597

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Refs LLM-Coding#597

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rdmueller rdmueller merged commit dc1772c into LLM-Coding:main Jun 10, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 356e60ba-7238-429f-939d-c82f56134075

📥 Commits

Reviewing files that changed from the base of the PR and between 7168915 and e9540c2.

📒 Files selected for processing (6)
  • docs/changelog.adoc
  • scripts/generate-jsonld.js
  • scripts/generate-sitemap.js
  • scripts/prerender-routes.js
  • scripts/render-docs.js
  • website/src/main.js

Walkthrough

Diese PR implementiert echte vorgerenderte Seiten für Anker-Details unter /anchor/<id> und lokalisierte Varianten unter /de/anchor/<id> statt nur SPA-Fallback. Build-Skripte rendern Anker-Fragmente aus AsciiDoc, extrahieren SEO-Metadaten und generieren vollständige HTML-Seiten mit kanonischen URLs und hreflang-Paaren für Suchmaschinen.

Changes

Anchor Detail Pages Pre-rendering

Layer / File(s) Summary
Description-Extraktion exportieren
scripts/generate-jsonld.js
Hilfsfunktion extractDescription wird in die CommonJS-Exports aufgenommen, um Beschreibungen für Anker-SEO-Metadaten zu ermöglichen.
Anker-Fragmente rendern
scripts/render-docs.js
renderFile erhält optionalen quiet-Parameter; neuer Loop iteriert über docs/anchors/*.adoc, rendert HTML-Fragmente unter website/public/docs/anchors/ und gibt Zählung aus.
Anchor-Detail-Seiten pre-rendern
scripts/prerender-routes.js
writeRouteVariant nimmt optionalen transformFragment-Callback auf; neue prerenderAnchorPages()-Funktion generiert EN- und DE-Seiten mit extractDescription-Metadaten, öffnet <details> serverseitig und aktualisiert Home-Katalog-Links; Integration in main().
Sitemap mit deutschen Varianten
scripts/generate-sitemap.js
Neuer deAnchorCount-Zähler; Schleife prüft per fs.existsSync auf docs/anchors/<id>.de.adoc und fügt /de/anchor/<id> zur Sitemap hinzu; Konsole-Ausgabe zählt deutsche URLs separat.
Dokumentation und Versionsbump
docs/changelog.adoc, website/src/main.js
Changelog dokumentiert Real-Anchor-Pages mit Lokalisierung und direkten Katalog-Links; Version wird auf 0.6.0 erhöht.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • LLM-Coding/Semantic-Anchors#114: Modifiziert die gleiche AsciiDoc→HTML-Pipeline in scripts/render-docs.js zur Pre-Rendering-Integration von Inhalten.
  • LLM-Coding/Semantic-Anchors#429: Erweitert die gleiche Routing-Infrastruktur in generate-sitemap.js und prerender-routes.js für pfadbasierte /anchor/<id>-Seiten statt Hash-Routen.
  • LLM-Coding/Semantic-Anchors#593: Modifiziert prerender-routes.js zur Expansion von SEO-Inhalten während Pre-Rendering, ergänzt um Katalog-Anpassungen für neue Anker-Seiten.

Suggested reviewers

  • JensGrote
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anchor detail pages /anchor/<id> are HTTP 404s — invisible to search engines despite being advertised in sitemap and JSON-LD

2 participants