docs: improve conventional route documentation with better examples and best practices#2995
docs: improve conventional route documentation with better examples and best practices#2995
Conversation
- `foo/bar.md` - `foo/index.md` - `foo.md` - `zoo/index.md`
1. 更新了路由说明,添加了 `/foo/index.md` 的路由路径说明 2. 更新了自定义行为部分的代码示例和注释 3. 添加了最佳实践的 tip 提示框 4. 添加了完整的项目结构示例、rspress.config.ts 和 tsconfig.json 配置示例
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Rspress documentation to address missing file examples and reorganize documentation structure. The main purpose is to add the missing zoo/index.md example mentioned in the routing convention documentation and improve the overall documentation organization by extracting reusable fragments.
Changes:
- Added missing
zoo/index.mdexample to the file structure documentation in conventional routing pages - Extracted common documentation fragments into reusable MDX files for better maintainability
- Reorganized component structure by moving Border component to a shared location
- Enhanced routing examples with cleaner URL configuration examples
- Updated both Chinese (zh) and English (en) documentation consistently
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| website/tsconfig.json | Removed redundant jsx: "preserve" configuration |
| website/docs/zh/guide/use-mdx/components.mdx | Updated section headings, extracted routing convention content to fragment, updated import paths |
| website/docs/zh/guide/use-mdx/_escape-hatch.tsx | Enhanced to use getCustomMDXComponent for better MDX component handling |
| website/docs/zh/guide/use-mdx/_button.mdx | Deleted and moved to fragments directory |
| website/docs/zh/guide/use-mdx/_Border.tsx | Deleted and moved to shared components directory |
| website/docs/zh/guide/basic/i18n.mdx | Added file structure example section |
| website/docs/zh/guide/basic/custom-theme.mdx | Added file structure example section |
| website/docs/zh/guide/basic/conventional-route.mdx | Added zoo/index.md example, enhanced routing table, extracted content to fragments |
| website/docs/zh/fragments/route-convention.mdx | New reusable fragment for routing convention documentation |
| website/docs/zh/fragments/file-structure.mdx | New reusable fragment showing best practice file structure |
| website/docs/zh/fragments/_button.mdx | New button example fragment for documentation |
| website/docs/en/guide/use-mdx/components.mdx | English version of zh changes |
| website/docs/en/guide/use-mdx/_escape-hatch.tsx | English version of zh changes |
| website/docs/en/guide/use-mdx/_button.mdx | Deleted and moved to fragments |
| website/docs/en/guide/basic/i18n.mdx | Added file structure example section |
| website/docs/en/guide/basic/custom-theme.mdx | Added file structure example section |
| website/docs/en/guide/basic/conventional-route.mdx | Added zoo/index.md example, enhanced routing documentation |
| website/docs/en/fragments/route-convention.mdx | English version of routing convention fragment |
| website/docs/en/fragments/file-structure.mdx | English version of file structure fragment |
| website/docs/en/fragments/_button.mdx | English version of button example fragment |
| website/docs/components/Border.tsx | Moved to shared location and enhanced with border radius styling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Related Issue
Checklist
AI Summary
Changes Made
This PR improves the conventional route documentation for both Chinese and English versions:
File structure examples:
foo/index.mdto demonstrate directory index routingzoo.mdto show simple file routingfoo.mdandfoo/index.mdcombinationNew warning section:
foo.mdandfoo/index.mdcannot coexist)Best practices section:
.tsxand.mdxfiles in thedocsdirectoryroute.excludefor non-route filescomponents/andfragments/directoriestsconfig.jsonconfiguration exampleCode organization:
file-structure.mdx,route-convention.mdx)_Why These Changes
The original documentation had inconsistencies between the file structure example and the mapping rules table. The examples also showed a conflicting file structure that would cause routing issues in practice. These updates make the documentation clearer, more accurate, and provide better guidance for users organizing their Rspress projects.
This PR was written using Vibe Kanban