Skip to content

fix(sync): prune orphaned pages + rewrite relative Laravel doc links#42

Merged
sandervanhooft merged 1 commit into
mainfrom
claude/fix-docs-orphan-prune
Jun 24, 2026
Merged

fix(sync): prune orphaned pages + rewrite relative Laravel doc links#42
sandervanhooft merged 1 commit into
mainfrom
claude/fix-docs-orphan-prune

Conversation

@sandervanhooft

Copy link
Copy Markdown
Member

Problem

Renaming a Laravel source doc left a duplicate page on the live site: the migration page showed up under both its old slug (coexisting-with-cashier) and its new one. Two bugs in the sync:

  1. No prune. transform-laravel-docs.mjs / transform-sdk-docs.mjs write/update target pages but never delete a target whose source was renamed away — so the old page (and its nav entry) lingered. The sync commits straight to main, so this was never caught by PR checks.
  2. Relative links resolved to mixed-case routes. The Laravel transform (unlike the SDK one) never rewrote relative sibling links, so ](Subscriptions.md) and ](./Webhooks) rendered as /packages/laravel/Subscriptions — which 404s on case-sensitive GitHub Pages.

Fix

  • Prune both transforms: clear previously-generated *.md in the target dir before regenerating, so renames/removals can't orphan. (Git diffs by content, so unchanged pages don't churn.)
  • Rewrite relative links in the Laravel transform — ](Name.md), ](./Name.md), ](./Name)](/packages/laravel/<lowercased>).
  • ORDER entries for the Comparison (6) and migration (7) pages so they sort after the API docs rather than the 99 bucket.
  • Regenerated the Laravel content accordingly (removes the coexisting-with-cashier orphan, renumbers, rewrites links, and picks up the new Migrating from Cashier title).

Verification (local)

  • npx nuxi build
  • Offline link scan across the whole built site: 0 broken internal links
  • markdownlint-cli2

Transforms only added/updated target pages and never deleted one whose source
was renamed away, leaving an orphaned page in the nav. Add a prune step to both
transforms. The laravel transform also never rewrote relative sibling links, so
](Name.md) / ](./Webhooks) resolved to mixed-case routes that 404 on
case-sensitive hosting; rewrite them to lowercase /packages/laravel/<slug>. Add
ORDER entries for Comparison (6) and the migration page (7). Regenerate content.

Verified locally: nuxi build passes, 0 broken internal links, markdownlint clean.
@sandervanhooft sandervanhooft force-pushed the claude/fix-docs-orphan-prune branch from 02a1688 to 1b2361b Compare June 24, 2026 18:08
@sandervanhooft sandervanhooft merged commit f42714e into main Jun 24, 2026
2 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.

1 participant