Skip to content

fix: legacy hash links in doc content are dead on pre-rendered pages#600

Merged
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:fix/599-legacy-hash-links
Jun 10, 2026
Merged

fix: legacy hash links in doc content are dead on pre-rendered pages#600
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:fix/599-legacy-hash-links

Conversation

@raifdmueller

@raifdmueller raifdmueller commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #599

What

Doc content shipped ~150 legacy hash-router links (link:#/anchor/<id>, link:#/about, …) that render as dead fragment URLs on the pre-rendered pages — /spec-driven-development/ alone had 40 of them (e.g. …/spec-driven-development/#/anchor/tdd-london-school). Crawlers and no-JS visitors couldn't follow any content link to the anchor pages that #598 just made indexable.

Fix (single point, sources untouched)

  • render-docs.js#renderFile(): rewrite href="#/…"href="/Semantic-Anchors/…" after AsciiDoc conversion. Covers all doc fragments, the full reference, and the per-anchor fragments. In-page TOC/section links (#section-id, no slash) are untouched.
  • render-contracts.js: emit clean anchor URLs directly (it generated its own #/anchor/<id> links).

The .adoc sources stay unchanged — the client-rendered anchor modal still converts them in the browser, where the router's legacy hash shim continues to handle them.

Verification

  • Post-build sweep: grep -rl 'href="#/' dist --include=index.htmlzero matches (before: doc pages + contracts).
  • No-JS (Playwright): followed /spec-driven-development/anchor/tdd-london-school link chain, lands on the real page ("TDD, London School — Semantic Anchors").
  • With JS: same click is router-intercepted — clean URL, anchor modal opens, no page errors.
  • 102 unit tests, 35 E2E tests, ESLint + Prettier green.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Links in der Dokumentation werden nun mit absoluten Pfaden anstelle von Hash-Navigation generiert
    • Legacy Hash-Links in Dokumentdateien werden automatisch in moderne URL-Formate konvertiert

The .adoc sources carry ~150 hash-router links (link:#/anchor/<id>, …)
that rendered as dead fragment URLs on the pre-rendered pages, e.g.
/spec-driven-development/#/anchor/tdd-london-school. renderFile() now
rewrites href="#/…" to href="/Semantic-Anchors/…" after conversion
(in-page #section links untouched), and render-contracts.js emits clean
anchor URLs directly. With JS the router intercepts the clean URLs for
SPA navigation; the client-rendered modal keeps its legacy shim.

Refs LLM-Coding#599

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: fec4d923-2346-47a1-80a9-ff78aa775627

📥 Commits

Reviewing files that changed from the base of the PR and between dc1772c and a5b49d3.

📒 Files selected for processing (2)
  • scripts/render-contracts.js
  • scripts/render-docs.js

Walkthrough

Die Build-Skripte werden aktualisiert, um ~150 Legacy-Hash-Links in statischen HTML-Ausgaben zu beheben. Verträge und Dokumentation migrieren von Hash-Fragment-Routes (#/anchor/<id>) zu clean absoluten Pfaden (/Semantic-Anchors/anchor/<id>), die ohne JavaScript funktionieren und crawlbar sind.

Changes

Legacy-Link-Migration in Rendering-Skripten

Layer / File(s) Zusammenfassung
Anchor-Links in gerenderten Verträgen aktualisieren
scripts/render-contracts.js
Der href-Wert für gerenderte Kontakt-Badges wird von Hash-Links #/anchor/<id> auf absolute Pfade /Semantic-Anchors/anchor/<id> geändert.
Legacy-Hash-Links in Dokumentation umschreiben
scripts/render-docs.js
Eine neue Hilfsfunktion rewriteLegacyHashLinks(html) mit Regex-Pattern wird eingeführt, um Legacy-href="#/…"-Router-Links vor der TOC-Extraktion in clean URLs umzuschreiben. renderFile nutzt diese Umwandlung, sodass Body und generierte TOC-Inhalte identische Links enthalten.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Der Titel beschreibt klar und prägnant die Hauptänderung: Legacy-Hash-Links in vorgerendertem Dokumentationsinhalt sind nicht funktional.
Linked Issues check ✅ Passed Die Änderungen erfüllen alle Anforderungen aus Issue #599: Legacy-Hash-Links werden durch absolute Pfade ersetzt, In-Page-Fragment-Links bleiben erhalten, und die AsciiDoc-Quellen bleiben unverändert.
Out of Scope Changes check ✅ Passed Alle Änderungen beziehen sich auf die Ziele von Issue #599; es wurden keine Änderungen außerhalb des Umfangs identifiziert.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@rdmueller rdmueller merged commit d044765 into LLM-Coding:main Jun 10, 2026
7 checks passed
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.

Doc content ships ~150 legacy hash links (#/anchor/...) that are dead on the pre-rendered pages

2 participants