feat: real pre-rendered pages for all 161 anchors (EN + 155 DE) — no more 404s#598
Conversation
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>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughDiese PR implementiert echte vorgerenderte Seiten für Anker-Details unter ChangesAnchor Detail Pages Pre-rendering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Closes #597
What
Every
/anchor/<id>URL returned HTTP 404 (SPA-fallback only) whilesitemap.xmland 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
render-docs.js): everydocs/anchors/*.adoc(161 EN + 155 DE) renders towebsite/public/docs/anchors/<id>(.de).htmlat prebuild — one summary log line, adds ~2s to the build.prerender-routes.js):dist/anchor/<id>/index.html+dist/de/anchor/<id>/index.htmlvia thewriteRouteVariant()/applyHead()machinery from fix: make the website navigable and readable without JavaScript (EN + DE) #596 — per-anchor<title>, meta description (viaextractDescription()reused fromgenerate-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./anchor/<id>; German catalog →/de/anchor/<id>where available) instead of/all-anchors#<id>./anchor/<id>entries become valid 200s; 155/de/anchor/<id>entries added (339 URLs total).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
161 anchor pages (+ 155 German variants)pre-rendered, build stays ~5s.javaScriptEnabled: false):/anchor/mece/shows title, expanded Core Concepts, header nav;/de/anchor/mece/islang="de"German.Note for review
anchors.jsonentries without an.adocfile 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
Documentation