Skip to content

Commit bb5fe3f

Browse files
Copilothotlong
andcommitted
Fix: Correct fumadocs link behavior - remove /docs/ prefix from markdown
I misunderstood how fumadocs links work. The baseUrl: '/docs' config means fumadocs AUTOMATICALLY prepends /docs to internal links at runtime. Links in markdown should NOT include /docs/ prefix: - ❌ WRONG: [Guide](/docs/guide/quick-start) → renders as /docs/docs/guide/quick-start - ✅ CORRECT: [Guide](/guide/quick-start) → fumadocs renders as /docs/guide/quick-start Changes: - Reverted all link "fixes" from commit fa7ae26 (those were breaking links) - Updated validation script to detect /docs/ prefix as an 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 on the Vercel deployment. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent fa7ae26 commit bb5fe3f

File tree

18 files changed

+83
-82
lines changed

18 files changed

+83
-82
lines changed

.github/workflows/validate-docs-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
const message = `⚠️ **Documentation Links Validation Found Issues**\n\n` +
6262
`The validation tool found broken links in the documentation. Run \`pnpm validate:links\` locally to see details.\n\n` +
6363
`Common issues:\n` +
64-
`- Missing \`/docs/\` prefix (internal links should use \`/docs/...\`)\n` +
65-
`- Incorrect paths (e.g., \`/api/core\` should be \`/docs/reference/api/core\`, \`/spec/\` should be \`/docs/architecture/\`)\n` +
64+
`- Incorrectly including \`/docs/\` prefix (fumadocs adds this automatically, so links should NOT include it)\n` +
65+
`- Incorrect paths (e.g., \`/api/core\` should be \`/reference/api/core\`, \`/spec/\` should be \`/architecture/\`)\n` +
6666
`- Links to non-existent files or routes\n\n` +
6767
`ℹ️ This is informational only and does not fail the build. Fix these issues in a follow-up PR if needed.`;
6868
github.rest.issues.createComment({

CONTRIBUTING.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -426,30 +426,30 @@ pnpm site:build
426426
#### ✅ Correct Link Patterns
427427

428428
```markdown
429-
<!-- Correct - internal documentation links MUST include /docs/ prefix -->
430-
[Quick Start](/docs/guide/quick-start)
431-
[Components](/docs/components)
432-
[API Reference](/docs/reference/api/core)
433-
[Protocol Specs](/docs/reference/protocol/overview)
434-
[Architecture](/docs/architecture/component)
429+
<!-- Correct - internal links should NOT include /docs/ prefix -->
430+
[Quick Start](/guide/quick-start)
431+
[Components](/components)
432+
[API Reference](/reference/api/core)
433+
[Protocol Specs](/reference/protocol/overview)
434+
[Architecture](/architecture/component)
435435
```
436436

437437
#### ❌ Incorrect Link Patterns
438438

439439
```markdown
440-
<!-- Wrong - missing /docs/ prefix -->
441-
[Quick Start](/guide/quick-start) <!-- ❌ Should be /docs/guide/quick-start -->
442-
[Components](/components) <!-- ❌ Should be /docs/components -->
440+
<!-- 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 -->
443443

444444
<!-- Wrong - incorrect paths -->
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 -->
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 -->
448448
```
449449

450450
#### Why?
451451

452-
Fumadocs is configured with `baseUrl: '/docs'`, which means all documentation pages are served under the `/docs` route. Internal links must include the `/docs/` prefix to match the actual URL structure where the pages are accessible.
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.
453453

454454
#### Validating Links
455455

@@ -462,7 +462,7 @@ pnpm validate:links
462462

463463
This will check:
464464
- Links point to existing files and routes
465-
- Links use correct path structure
465+
- Links do NOT incorrectly include /docs/ prefix
466466
- Suggestions for fixing common issues
467467

468468
The validation runs automatically on PRs that modify documentation files.

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Use relative links for internal documentation:
213213

214214
```markdown
215215
See [Schema Rendering](./schema-rendering.md) for details.
216-
See [Protocol Overview](/docs/reference/protocol/overview) for specs.
216+
See [Protocol Overview](/protocol/overview) for specs.
217217
```
218218

219219
### Front Matter

docs/architecture/base-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This specification defines the metadata structure for ObjectQL's built-in platfo
1414
- Enable marketplace distribution
1515

1616
**Scope:** This document covers the complete metadata specification for all platform base components, including data display, data entry, layout, navigation, and visualization components.
17-
For the low-level UI component library (Button, Input, Dialog, etc.), please refer to the [Component Library Reference](/docs/architecture/component-library).
17+
For the low-level UI component library (Button, Input, Dialog, etc.), please refer to the [Component Library Reference](component-library.md).
1818

1919
## 2. Base Component Categories
2020

docs/concepts/component-registry.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@ export { RatingComponent }
459459

460460
- [Expression System](./expressions.md) - Learn about dynamic expressions
461461
- [Schema Rendering](./schema-rendering.md) - Understand the rendering engine
462-
- [Creating Custom Components](/docs/architecture/component-package) - Deep dive into component creation
462+
- [Creating Custom Components](/spec/component-package.md) - Deep dive into component creation
463463

464464
## Related Documentation
465465

466-
- [Core API](/docs/reference/api/core) - Component registry API
467-
- [React API](/docs/reference/api/react) - React integration
468-
- [Component Specification](/docs/architecture/component) - Component metadata spec
466+
- [Core API](/api/core) - Component registry API
467+
- [React API](/api/react) - React integration
468+
- [Component Specification](/spec/component.md) - Component metadata spec

docs/concepts/expressions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,10 @@ const data: UserData = { /* ... */ }
636636

637637
- [Schema Rendering](./schema-rendering.md) - Learn the rendering engine
638638
- [Component Registry](./component-registry.md) - Understand components
639-
- [Protocol Overview](/docs/reference/protocol/overview) - Explore schema specifications
639+
- [Protocol Overview](/protocol/overview) - Explore schema specifications
640640

641641
## Related Documentation
642642

643-
- [Core API](/docs/reference/api/core) - Expression evaluator API
644-
- [Form Protocol](/docs/reference/protocol/form) - Form-specific expressions
645-
- [View Protocol](/docs/reference/protocol/view) - Data view expressions
643+
- [Core API](/api/core) - Expression evaluator API
644+
- [Form Protocol](/protocol/form) - Form-specific expressions
645+
- [View Protocol](/protocol/view) - Data view expressions

docs/concepts/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export function registerComponents() {
373373
- [Component Registry](./component-registry.md) - Understanding the registry
374374
- [Schema Rendering](./schema-rendering.md) - How schemas become UI
375375
- [Lazy-Loaded Plugins Architecture](./lazy-loading.md) - Deep dive
376-
- [Creating Components](/docs/architecture/component-package) - Component development
376+
- [Creating Components](/spec/component-package.md) - Component development
377377
378378
## Next Steps
379379

docs/concepts/schema-rendering.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,11 @@ Always type your schemas for better IDE support and fewer runtime errors.
411411

412412
- [Component Registry](./component-registry.md) - Learn about component registration
413413
- [Expression System](./expressions.md) - Master expressions
414-
- [Protocol Overview](/docs/reference/protocol/overview) - Explore all available schemas
414+
- [Protocol Overview](/protocol/overview) - Explore all available schemas
415415

416416
## Related Documentation
417417

418-
- [Rendering Specification](/docs/architecture/rendering-specification) - Technical specification
419-
- [Architecture](/docs/architecture) - System architecture
420-
- [Core API](/docs/reference/api/core) - Core package API reference
421-
- [React API](/docs/reference/api/react) - React package API reference
418+
- [Schema Specification](/spec/schema-rendering) - Technical specification
419+
- [Architecture](/spec/architecture) - System architecture
420+
- [Core API](/api/core) - Core package API reference
421+
- [React API](/api/react) - React package API reference

docs/guide/studio.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ It is **not** designed for:
189189

190190
## What's Next?
191191

192-
- [Read the full guide](/docs/guide)
193-
- [Explore the API reference](/docs/reference/api/react)
194-
- [Check out component specifications](/docs/reference/protocol/overview)
195-
- [View the project roadmap](https://github.com/objectstack-ai/objectui)
192+
- [Read the full guide](/docs/guide/introduction)
193+
- [Explore the API reference](/docs/api/react)
194+
- [Check out component specifications](/docs/protocol/overview)
195+
- [View the project roadmap](/ROADMAP)
196196

197197
## Feedback
198198

docs/migration/from-objectstack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ The integration follows this hierarchy:
148148

149149
If you encounter any issues:
150150

151-
1. Check the [adapter README](https://github.com/objectstack-ai/objectui/tree/main/packages/core/src/adapters)
151+
1. Check the [adapter README](packages/core/src/adapters/README.md)
152152
2. Review the [ObjectStack spec](https://github.com/objectstack-ai/spec)
153153
3. Open an issue on GitHub
154154

0 commit comments

Comments
 (0)