Skip to content

fix(docs): resolve relative markdown and wiki links across Fumadocs and GitHub wiki - #11834

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
AndrianBalanescu:fix/wiki-doc-links
Aug 30, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
AndrianBalanescu:fix/wiki-doc-links

Conversation

@AndrianBalanescu

Copy link
Copy Markdown
Contributor

Summary

Fixes broken relative cross-doc links across both dashboard docs (Fumadocs) and the GitHub wiki:

  1. Fumadocs Dashboard Docs: Navigating through relative links like [AUTO-COMBO.md](../routing/AUTO-COMBO.md) previously retained the .md extension in the URL, causing Next.js client-side 404s. src/lib/docsLinkResolver.ts resolves relative doc links to extensionless slug paths (/docs/routing/AUTO-COMBO), maps repo-level code links (../../src/...) to GitHub blob URLs, and normalizes links in i18n markdown rendering.
  2. GitHub Wiki Sync: scripts/docs/sync-wiki.mjs now rewrites relative links in synced docs to flat GitHub wiki page names (e.g. Auto-Combo#14-factors), images to raw GitHub URLs, and repo code links to GitHub blob URLs.

Changes

  • src/lib/docsLinkResolver.ts: Pure helper functions resolveDocHref and normalizeDocsMarkdownLinks
  • src/app/docs/[...slug]/page.tsx: MDX custom a component wrapping resolveDocHref, plus link normalization in tryI18nFallback
  • scripts/docs/sync-wiki.mjs: Added rewriteWikiLinks and integrated into toWikiContent and main()
  • tests/unit/docs-link-resolver.test.ts: 6 unit tests covering all doc-to-doc, hash, repo escaping, and external link cases
  • tests/unit/sync-wiki.test.ts: Added 5 unit tests for wiki link rewriting, image rewriting, anchor preservation, and localized wiki page prefixes

Validation

  • npm run check:docs-all (passed: docs-sync, docs-counts, env-doc-sync, deprecated-versions, doc-links, fabricated-docs)
  • node --import tsx/esm --test tests/unit/sync-wiki.test.ts (13/13 passing)
  • node --import tsx/esm --test tests/unit/docs-link-resolver.test.ts (6/6 passing)
  • npm run lint & npm run typecheck:core (clean)

@diegosouzapw
diegosouzapw merged commit 4c187de into diegosouzapw:release/v3.8.51 Aug 30, 2026
16 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…nd GitHub wiki (diegosouzapw#11834)

Resolução de links relativos entre Fumadocs e a wiki do GitHub, com dois arquivos de teste novos e bem focados (`docs-link-resolver.test.ts`, `sync-wiki.test.ts`). Validado no worktree combinado. Obrigado!
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.

2 participants