You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Correct fumadocs link behavior - links SHOULD include /docs/ prefix
After testing, confirmed that fumadocs baseUrl: '/docs' means docs are served
at /docs/* routes, and internal links MUST include /docs/ prefix.
My previous understanding was incorrect. The correct behavior:
- ✅ CORRECT: [Guide](/docs/guide/quick-start) → works at /docs/guide/quick-start
- ❌ WRONG: [Guide](/guide/quick-start) → 404 error
Changes:
- Fixed Quick Links in docs/index.md (added /docs/ prefix)
- Fixed hero actions in docs/index.md (added /docs/ prefix)
- Fixed all MDX files to use /docs/ prefix instead of relative paths
- Updated validation script to accept /docs/ prefix (not error)
- Updated CONTRIBUTING.md with correct link conventions
- Updated scripts/README.md with correct examples
- Updated GitHub Actions workflow message with correct guidance
This fixes the broken links reported by @hotlong on the deployed site.
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
<!-- Wrong - includes /docs/ prefix (fumadocs adds this automatically)-->
441
-
[Quick Start](/docs/guide/quick-start)<!-- ❌ Should be /guide/quick-start -->
442
-
[Components](/docs/components)<!-- ❌ Should be /components -->
440
+
<!-- Wrong - missing /docs/ prefix -->
441
+
[Quick Start](/guide/quick-start)<!-- ❌ Should be /docs/guide/quick-start -->
442
+
[Components](/components)<!-- ❌ Should be /docs/components -->
443
443
444
444
<!-- Wrong - incorrect paths -->
445
-
[API Reference](/api/core)<!-- ❌ Should be /reference/api/core -->
446
-
[Spec](/spec/component)<!-- ❌ Should be /architecture/component -->
447
-
[Protocol](/protocol/form)<!-- ❌ Should be /reference/protocol/form -->
445
+
[API Reference](/api/core)<!-- ❌ Should be /docs/reference/api/core -->
446
+
[Spec](/spec/component)<!-- ❌ Should be /docs/architecture/component -->
447
+
[Protocol](/protocol/form)<!-- ❌ Should be /docs/reference/protocol/form -->
448
448
```
449
449
450
450
#### Why?
451
451
452
-
Fumadocs is configured with `baseUrl: '/docs'`, which automatically prepends `/docs`to all internal links at runtime. If you include `/docs/`in your markdown links, the final URL will be `/docs/docs/...` (double prefix), causing 404 errors.
452
+
Fumadocs is configured with `baseUrl: '/docs'`, which means all documentation pages are served under the `/docs`route in Next.js. Internal links must include the `/docs/`prefix to match the actual URL structure where the pages are accessible.
453
453
454
454
#### Validating Links
455
455
@@ -462,7 +462,7 @@ pnpm validate:links
462
462
463
463
This will check:
464
464
- Links point to existing files and routes
465
-
- Links do NOT incorrectly include /docs/ prefix
465
+
- Links use correct path structure with /docs/ prefix
466
466
- Suggestions for fixing common issues
467
467
468
468
The validation runs automatically on PRs that modify documentation files.
[API](/api/core)<!-- ❌ Should be /docs/reference/api/core -->
50
+
[Spec](/spec/component)<!-- ❌ Should be /docs/architecture/component -->
51
51
```
52
52
53
53
## Why These Conventions?
54
54
55
-
Fumadocs is configured with `baseUrl: '/docs'`, which automatically prepends `/docs`to all internal links at runtime. If you include `/docs/`in your markdown links, the final URL will be `/docs/docs/...` (double prefix), causing 404 errors.
55
+
Fumadocs is configured with `baseUrl: '/docs'`, which means all documentation pages are served under the `/docs`route in Next.js. Internal links must include the `/docs/`prefix to match the actual URL structure where the pages are accessible.
0 commit comments