Skip to content

Commit 3228883

Browse files
authored
Merge pull request #152 from objectstack-ai/copilot/fix-link-404-errors
2 parents d993a2b + c34321a commit 3228883

File tree

7 files changed

+177
-54
lines changed

7 files changed

+177
-54
lines changed

.github/workflows/check-links.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check Links
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
check-links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Check links with Lychee
17+
uses: lycheeverse/lychee-action@v1
18+
with:
19+
# Scan all markdown files in docs directory and README
20+
args: |
21+
--verbose
22+
--no-progress
23+
--config lychee.toml
24+
'docs/**/*.md'
25+
'docs/**/*.mdx'
26+
'README.md'
27+
# Fail the action on broken links
28+
fail: true
29+
env:
30+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.lycheeignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore localhost links (development/testing)
2+
http://localhost*
3+
4+
# Ignore example links
5+
https://example.com
6+
7+
# Ignore social media links (anti-scraping measures)
8+
https://twitter.com*
9+
https://x.com*

CONTRIBUTING.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,14 @@ Our repository includes several automated GitHub workflows that will run when yo
400400

401401
### Writing Documentation
402402

403-
We use VitePress for documentation. All docs are in `docs/`.
403+
We use fumadocs for documentation. All docs are in `docs/`.
404404

405405
```bash
406406
# Start docs dev server
407-
pnpm docs:dev
407+
pnpm site:dev
408408

409409
# Build docs
410-
pnpm docs:build
410+
pnpm site:build
411411
```
412412

413413
### Documentation Guidelines
@@ -419,6 +419,42 @@ pnpm docs:build
419419
- Add practical, real-world examples
420420
- Link to related documentation
421421

422+
### Documentation Link Conventions
423+
424+
**IMPORTANT**: When adding internal links in documentation, follow these conventions to avoid 404 errors:
425+
426+
#### ✅ Correct Link Patterns
427+
428+
```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)
435+
```
436+
437+
#### ❌ Incorrect Link Patterns
438+
439+
```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 -->
443+
444+
<!-- 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 -->
448+
```
449+
450+
#### Why?
451+
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+
454+
#### Validating Links
455+
456+
Link validation runs automatically via GitHub Actions on all PRs using lychee-action. This checks for broken internal and external links.
457+
422458
See [Documentation Guide](./docs/README.md) for details.
423459

424460
## Versioning and Releases

docs/index.md

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ hero:
1010
actions:
1111
- theme: brand
1212
text: Get Started
13-
link: /guide/quick-start
13+
link: /docs/guide/quick-start
1414
- theme: alt
1515
text: View Components
16-
link: /components/
16+
link: /docs/components/
1717
- theme: alt
1818
text: Read Docs
19-
link: /guide/
19+
link: /docs/guide/
2020

2121
features:
2222
- title: 🎨 The Stack You Love
@@ -30,21 +30,21 @@ features:
3030
## Quick Links
3131

3232
### For Users
33-
- 📖 [**Quick Start**](/guide/quick-start) - Get started in 5 minutes
34-
- 🎨 [**Showcase**](/guide/showcase) - See all 60+ components in action
35-
- 📦 [**Installation**](/guide/installation) - Setup instructions
36-
- 🧩 [**Components**](/components/) - Component library reference
33+
- 📖 [**Quick Start**](/docs/guide/quick-start) - Get started in 5 minutes
34+
- 🎨 [**Showcase**](/docs/guide/showcase) - See all 60+ components in action
35+
- 📦 [**Installation**](/docs/guide/installation) - Setup instructions
36+
- 🧩 [**Components**](/docs/components/) - Component library reference
3737

3838
### For Developers
39-
- 🤝 [**Contributing Guide**](/community/contributing) - How to contribute
40-
- 📚 [**Architecture**](/architecture/architecture) - Technical architecture
41-
- 🔧 [**API Reference**](/reference/api/core) - Complete API docs
42-
- 🗺️ [**Roadmap**](/community/roadmap) - Upcoming features
39+
- 🤝 [**Contributing Guide**](/docs/community/contributing) - How to contribute
40+
- 📚 [**Architecture**](/docs/architecture/architecture) - Technical architecture
41+
- 🔧 [**API Reference**](/docs/reference/api/core) - Complete API docs
42+
- 🗺️ [**Roadmap**](/docs/community/roadmap) - Upcoming features
4343

4444
### Need Help?
45-
-[**FAQ**](/faq) - Frequently asked questions
46-
- 🔧 [**Troubleshooting**](/troubleshooting) - Common issues and solutions
47-
- 🔒 [**Security**](/security) - Security best practices
45+
-[**FAQ**](/docs/faq) - Frequently asked questions
46+
- 🔧 [**Troubleshooting**](/docs/troubleshooting) - Common issues and solutions
47+
- 🔒 [**Security**](/docs/security) - Security best practices
4848
- 💬 [**Discussions**](https://github.com/objectstack-ai/objectui/discussions) - Ask questions
4949

5050
---
@@ -145,7 +145,7 @@ cd my-admin
145145
objectui dev
146146
```
147147

148-
[**📖 CLI Guide →**](/guide/cli/getting-started)
148+
[**📖 CLI Guide →**](/docs/guide/cli/getting-started)
149149

150150
### Option B: React Library
151151

@@ -173,66 +173,66 @@ function App() {
173173
}
174174
```
175175

176-
[**📖 Installation Guide →**](/guide/installation)
176+
[**📖 Installation Guide →**](/docs/guide/installation)
177177

178178
---
179179

180180
## Documentation Structure
181181

182182
### 📘 Getting Started
183183
Start here if you're new to ObjectUI
184-
- [Quick Start](/guide/quick-start)
185-
- [Installation](/guide/installation)
186-
- [Showcase](/guide/showcase)
184+
- [Quick Start](/docs/guide/quick-start)
185+
- [Installation](/docs/guide/installation)
186+
- [Showcase](/docs/guide/showcase)
187187

188188
### 🧩 Components
189189
Browse all available components
190-
- [Component Gallery](/components/)
191-
- [Form Components](/components/form/)
192-
- [Layout Components](/components/layout/)
190+
- [Component Gallery](/docs/components/)
191+
- [Form Components](/docs/components/form/)
192+
- [Layout Components](/docs/components/layout/)
193193

194194
### 💡 Core Concepts
195195
Understand how ObjectUI works
196-
- [Schema Rendering](/concepts/schema-rendering)
197-
- [Expressions](/concepts/expressions)
198-
- [Data Sources](/concepts/data-source)
196+
- [Schema Rendering](/docs/concepts/schema-rendering)
197+
- [Expressions](/docs/concepts/expressions)
198+
- [Data Sources](/docs/concepts/data-source)
199199

200200
### 🔌 Plugins
201201
Extend ObjectUI with plugins
202-
- [Plugin System](/concepts/plugins)
203-
- [Charts Plugin](/plugins/plugin-charts)
204-
- [Kanban Plugin](/plugins/plugin-kanban)
202+
- [Plugin System](/docs/concepts/plugins)
203+
- [Charts Plugin](/docs/plugins/plugin-charts)
204+
- [Kanban Plugin](/docs/plugins/plugin-kanban)
205205

206206
### 📚 Reference
207207
Detailed API documentation
208-
- [Core API](/reference/api/core)
209-
- [React API](/reference/api/react)
210-
- [Protocol Specifications](/reference/protocol/overview)
208+
- [Core API](/docs/reference/api/core)
209+
- [React API](/docs/reference/api/react)
210+
- [Protocol Specifications](/docs/reference/protocol/overview)
211211

212212
### 🏗️ Architecture
213213
For contributors and advanced users
214-
- [System Architecture](/architecture/architecture)
215-
- [Project Structure](/architecture/project-structure)
216-
- [Component Specs](/architecture/component)
214+
- [System Architecture](/docs/architecture/architecture)
215+
- [Project Structure](/docs/architecture/project-structure)
216+
- [Component Specs](/docs/architecture/component)
217217

218218
### 🌐 Ecosystem
219219
Integration and deployment
220-
- [ObjectQL Integration](/ecosystem/objectql)
221-
- [API Integration](/ecosystem/api)
222-
- [Deployment Guide](/ecosystem/deployment/showcase-deployment)
220+
- [ObjectQL Integration](/docs/ecosystem/objectql)
221+
- [API Integration](/docs/ecosystem/api)
222+
- [Deployment Guide](/docs/ecosystem/deployment/showcase-deployment)
223223

224224
### 🆘 Support
225225
Get help when you need it
226-
- [FAQ](/faq) - Common questions
227-
- [Troubleshooting](/troubleshooting) - Problem solving
228-
- [Security](/security) - Security best practices
229-
- [Migration](/migration/from-objectstack) - Migration guides
226+
- [FAQ](/docs/faq) - Common questions
227+
- [Troubleshooting](/docs/troubleshooting) - Problem solving
228+
- [Security](/docs/security) - Security best practices
229+
- [Migration](/docs/migration/from-objectstack) - Migration guides
230230

231231
### 🤝 Community
232232
Contribute and collaborate
233-
- [Contributing](/community/contributing)
234-
- [Roadmap](/community/roadmap)
235-
- [Best Practices](/community/best-practices)
233+
- [Contributing](/docs/community/contributing)
234+
- [Roadmap](/docs/community/roadmap)
235+
- [Best Practices](/docs/community/best-practices)
236236

237237
---
238238

@@ -241,8 +241,8 @@ Contribute and collaborate
241241
Stop writing repetitive UI code. Start building with ObjectUI.
242242

243243
<div style="display: flex; gap: 1rem; margin-top: 2rem;">
244-
<a href="/guide/quick-start" style="padding: 0.75rem 1.5rem; background: #3b82f6; color: white; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">Get Started →</a>
245-
<a href="/components/" style="padding: 0.75rem 1.5rem; border: 1px solid #3b82f6; color: #3b82f6; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">View Components</a>
246-
<a href="/guide/showcase" style="padding: 0.75rem 1.5rem; border: 1px solid #6b7280; color: #6b7280; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">Try Showcase</a>
244+
<a href="/docs/guide/quick-start" style="padding: 0.75rem 1.5rem; background: #3b82f6; color: white; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">Get Started →</a>
245+
<a href="/docs/components/" style="padding: 0.75rem 1.5rem; border: 1px solid #3b82f6; color: #3b82f6; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">View Components</a>
246+
<a href="/docs/guide/showcase" style="padding: 0.75rem 1.5rem; border: 1px solid #6b7280; color: #6b7280; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">Try Showcase</a>
247247
</div>
248248

docs/plugins/plugin-markdown.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ npm install our-package
189189
2. Configure your settings
190190
3. Start building!
191191
192-
For more information, see the [API Reference](/api).
192+
For more information, see the [API Reference](/docs/reference/api/core).
193193
`,
194194
className: 'prose prose-lg max-w-none'
195195
}
@@ -230,7 +230,7 @@ app.run()
230230
231231
## Contributing
232232
233-
Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md).
233+
Contributions are welcome! Please read our [contributing guidelines](https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md).
234234
235235
## License
236236

docs/plugins/plugin-object.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ const dataSource = new ObjectQLDataSource({
539539

540540
## Related Documentation
541541

542-
- [ObjectQL Integration](/docs/ecosystem/objectql.md)
543-
- [Data Sources](/docs/concepts/data-source.md)
542+
- [ObjectQL Integration](/docs/ecosystem/objectql)
543+
- [Data Sources](/docs/concepts/data-source)
544544
- [Plugin System Overview](/docs/concepts/plugins)
545545
- [Package README](https://github.com/objectstack-ai/objectui/tree/main/packages/plugin-object)

lychee.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Lychee configuration file for ObjectUI documentation link checking
2+
# This configuration enables checking internal fumadocs links by mapping
3+
# Next.js routes (e.g., /docs/guide) to filesystem paths (e.g., docs/guide.mdx)
4+
5+
# Maximum number of concurrent requests
6+
max_concurrency = 10
7+
8+
# Timeout for each request (in seconds)
9+
timeout = 20
10+
11+
# Number of retries per request
12+
max_retries = 3
13+
14+
# Accept any valid status code (2xx, 3xx)
15+
accept = [200, 204, 206, 301, 302, 303, 307, 308]
16+
17+
# Exclude patterns - files and URLs to skip
18+
exclude = [
19+
# Local development URLs
20+
"http://localhost*",
21+
"https://localhost*",
22+
23+
# Example and placeholder URLs
24+
"https://example.com",
25+
"http://example.com",
26+
27+
# Social media (anti-scraping)
28+
"https://twitter.com*",
29+
"https://x.com*",
30+
31+
# GitHub specific patterns that may cause false positives
32+
"https://github.com/.*/compare/*",
33+
"https://github.com/.*/commit/*",
34+
]
35+
36+
# Path remapping for fumadocs internal links
37+
# Maps Next.js routes to actual file paths
38+
# Format: ["pattern to match", "replacement"]
39+
remap = [
40+
# Map /docs/* links to docs/ filesystem paths
41+
# The file:// prefix tells lychee to check local files
42+
"^/docs/(.*)$ file://./docs/$1"
43+
]
44+
45+
# Cache configuration
46+
[cache]
47+
# Don't use cache to ensure fresh results
48+
max_age = "0s"

0 commit comments

Comments
 (0)