Skip to content

docs: update auto-nav-sidebar to recommend index.mdx for dir, index convention#2978

Merged
SoonIter merged 6 commits intomainfrom
syt-vibe-kanban/2f22-auto-nav-sidebar
Jan 8, 2026
Merged

docs: update auto-nav-sidebar to recommend index.mdx for dir, index convention#2978
SoonIter merged 6 commits intomainfrom
syt-vibe-kanban/2f22-auto-nav-sidebar

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Jan 8, 2026

Summary

Update the auto-nav-sidebar documentation to recommend using index.mdx inside directories instead of creating a same-named file at the same level.

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

AI Summary

Changes Made

Documentation updates for both English and Chinese versions:

  1. Moved the tip from the divider section to the dir section, which is more contextually appropriate since it relates to directory behavior

  2. Updated the recommended approach for displaying a document when clicking on a sidebar directory:

    • Before: Create a same-named md(x) file at the same level as the directory (e.g., advanced.mdx alongside advanced/)
    • After: Create an index.mdx file inside the directory (e.g., basic/index.mdx)
  3. Improved the example with a clearer file tree structure showing docs/basic/ containing index.mdx, getting-started.mdx, and _meta.json

  4. Added code block showing the _meta.json content with explanation that it only needs to list the other documents (not index)

Why These Changes

The index.mdx approach is the recommended pattern as it:

  • Keeps related files together in the same directory
  • Is more intuitive and follows common conventions
  • Makes the directory structure cleaner

This PR was written using Vibe Kanban


1. **将 tip 移动到 `dir` 部分** - 从 `divider` 部分移除,放到 `dir` 部分的示例代码后面
2. **更新推荐用法** - 不再推荐同名文件方式,改为推荐在目录内创建 `index.mdx`
3. **更新文件树示例** - 使用 tree 代码块展示:
   ```
   basic
   ├── index.mdx
   ├── getting-started.mdx
   └── _meta.json
   ```
4. **说明 `_meta.json` 内容** - 添加了 `["getting-started"]`(不需要包含 `index`)的说明
1. **文件树添加顶层 `docs` 目录**
2. **`_meta.json` 内容单独用代码块展示**,带 `title="_meta.json"`
3. **更新说明文字** - "意为侧边栏里仅含有 `getting-started` 这一篇文档,当你点击 `Basic` 目录时,会显示 `index.mdx` 文件的内容。"
Copilot AI review requested due to automatic review settings January 8, 2026 09:51
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 8, 2026

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 7ab933f
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/695f84aa6ebad500081e3b77
😎 Deploy Preview https://deploy-preview-2978--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SoonIter SoonIter changed the title 更新 auto-nav-sidebar 用法文档 (vibe-kanban) docs: update auto-nav-sidebar to recommend index.mdx for directory landing pages Jan 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 8, 2026

Rsdoctor Bundle Diff Analysis

Found 3 projects in monorepo, 3 projects with changes.

📊 Quick Summary
Project Total Size Change
node 9.6 MB +123.0 B (0.0%)
node_md 1.2 MB -870.0 B (-0.1%)
web 15.5 MB -482.0 B (-0.0%)
📋 Detailed Reports (Click to expand)

📁 node

Path: website/doc_build/diff-rsdoctor/node/rsdoctor-data.json

📌 Baseline Commit: e83a0f65f5 | PR: #2977

Metric Current Baseline Change
📊 Total Size 9.6 MB 9.6 MB +123.0 B (0.0%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 9.6 MB 9.6 MB +123.0 B (0.0%)
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: node Bundle Diff

📁 node_md

Path: website/doc_build/diff-rsdoctor/node_md/rsdoctor-data.json

📌 Baseline Commit: e83a0f65f5 | PR: #2977

Metric Current Baseline Change
📊 Total Size 1.2 MB 1.2 MB -870.0 B (-0.1%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 1.2 MB 1.2 MB -870.0 B (-0.1%)

📦 Download Diff Report: node_md Bundle Diff

📁 web

Path: website/doc_build/diff-rsdoctor/web/rsdoctor-data.json

📌 Baseline Commit: e83a0f65f5 | PR: #2977

Metric Current Baseline Change
📊 Total Size 15.5 MB 15.5 MB -482.0 B (-0.0%)
📄 JavaScript 14.8 MB 14.8 MB +155.0 B (0.0%)
🎨 CSS 130.2 KB 130.2 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 555.4 KB 556.0 KB -637.0 B (-0.1%)

📦 Download Diff Report: web Bundle Diff

Generated by Rsdoctor GitHub Action

1. **删除了同名文件方式** - 移除了"在上级目录新建同名文件 `theme.md`"的方式
2. **只保留 `index.md` 方式** - 推荐在目录内创建 `index.md`
3. **优化文件树格式** - 使用规范的 tree 格式,移除了 `// ...` 注释
4. **添加 JSON 代码块标题** - `title="theme/_meta.json"`
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation for the auto-nav-sidebar feature to reflect current best practices. The tip about displaying a document when clicking a sidebar directory has been moved from the "divider" section to the "dir" section and updated to recommend the index.mdx approach over the deprecated same-name sibling file approach.

  • Moved tip section from after "divider" to after "dir" type definition for better context
  • Updated recommendation from creating sibling files with same name to using index.mdx inside directories
  • Updated file tree examples to demonstrate the new recommended approach

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/zh/guide/basic/auto-nav-sidebar.mdx Chinese documentation updated with repositioned tip and new index.mdx recommendation
website/docs/en/guide/basic/auto-nav-sidebar.mdx English documentation updated with repositioned tip and new index.mdx recommendation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

1. **删除了 `theme/_meta.json` 代码块**
2. **添加了 `index.md` 示例代码块**,展示 frontmatter 配置和描述内容
@SoonIter SoonIter changed the title docs: update auto-nav-sidebar to recommend index.mdx for directory landing pages docs: update auto-nav-sidebar to recommend index.mdx for dir, index convention Jan 8, 2026
@SoonIter SoonIter enabled auto-merge (squash) January 8, 2026 10:13
@SoonIter SoonIter requested review from Timeless0911 and removed request for Timeless0911 January 8, 2026 10:14
1. **更新文件树结构** - 添加了 `guide` 子目录,展示更完整的层级关系
2. **添加两个 `_meta.json` 示例**:
   - `basic/_meta.json`: `[{ "type": "dir", "name": "guide" }]`
   - `guide/_meta.json`: `["getting-started"]`
3. **更新说明文字** - 改为"点击 `Guide` 目录时"
@SoonIter SoonIter requested a review from Timeless0911 January 8, 2026 10:22
@SoonIter SoonIter merged commit 5802acd into main Jan 8, 2026
8 checks passed
@SoonIter SoonIter deleted the syt-vibe-kanban/2f22-auto-nav-sidebar branch January 8, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants