Skip to content

docs: add missing Layout slots (beforeNavMenu, afterNav) and add Layout Slots heading (Vibe Kanban)#2964

Merged
SoonIter merged 1 commit intomainfrom
vk/ca6d-guide-basic-cust
Jan 6, 2026
Merged

docs: add missing Layout slots (beforeNavMenu, afterNav) and add Layout Slots heading (Vibe Kanban)#2964
SoonIter merged 1 commit intomainfrom
vk/ca6d-guide-basic-cust

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Jan 6, 2026

Summary

This PR improves the custom theme documentation by:

  • Adding missing beforeNavMenu and afterNav slot documentation to the Layout component props
  • Adding a "Layout Slots" / "Layout 插槽" subheading for better documentation structure

Changes Made

Missing Slots Added

  • beforeNavMenu - Content rendered before the nav bar menu
  • afterNav - Content rendered after the nav bar

These slots were available in the Layout component (packages/core/src/theme/layout/Layout/index.tsx) but were not documented.

Documentation Structure

  • Added ### Layout Slots (English) / ### Layout 插槽 (Chinese) heading to clearly identify the slot props section
  • Updated the comment for afterNavMenu to be more descriptive ("After nav bar menu" instead of "Upper right corner of nav bar")

Why

The documentation was incomplete - users looking to customize their theme layout could not discover the beforeNavMenu and afterNav slots without reading the source code. This PR ensures all Layout slots are properly documented.


This PR was written using Vibe Kanban

Copilot AI review requested due to automatic review settings January 6, 2026 06:44
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 6, 2026

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 64991b0
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/695ccc2e1028aa0009395424
😎 Deploy Preview https://deploy-preview-2964--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 修改文档 /guide/basic/custom-theme (vibe-kanban) docs: add missing Layout slots (beforeNavMenu, afterNav) and add Layout Slots heading (Vibe Kanban) Jan 6, 2026
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 improves the Layout component documentation by adding missing slot documentation and better organization. The changes ensure that all Layout component slots are properly documented with consistent formatting across both Chinese and English versions.

  • Added missing beforeNavMenu and afterNav slot documentation
  • Added "Layout 插槽" / "Layout Slots" section heading for better organization
  • Updated afterNavMenu comment for clarity

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/custom-theme.mdx Added Layout Slots heading, documented missing beforeNavMenu and afterNav slots, and updated comments in Chinese
website/docs/en/guide/basic/custom-theme.mdx Added Layout Slots heading, documented missing beforeNavMenu and afterNav slots, and updated comments in English

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 6, 2026

Rsdoctor Bundle Diff Analysis

Found 3 projects in monorepo, 3 projects with changes.

📊 Quick Summary
Project Total Size Change
node 9.5 MB +2.5 KB (0.0%)
node_md 1.2 MB +502.0 B (0.0%)
web 15.3 MB +3.7 KB (0.0%)
📋 Detailed Reports (Click to expand)

📁 node

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

📌 Baseline Commit: 7d8ac9b51c | PR: #2935

Metric Current Baseline Change
📊 Total Size 9.5 MB 9.5 MB +2.5 KB (0.0%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 9.5 MB 9.5 MB +2.5 KB (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: 7d8ac9b51c | PR: #2935

Metric Current Baseline Change
📊 Total Size 1.2 MB 1.2 MB +502.0 B (0.0%)
📄 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 +502.0 B (0.0%)

📦 Download Diff Report: node_md Bundle Diff

📁 web

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

📌 Baseline Commit: 7d8ac9b51c | PR: #2935

Metric Current Baseline Change
📊 Total Size 15.3 MB 15.3 MB +3.7 KB (0.0%)
📄 JavaScript 14.6 MB 14.6 MB +3.6 KB (0.0%)
🎨 CSS 128.4 KB 128.4 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 555.7 KB 555.6 KB +138.0 B (0.0%)

📦 Download Diff Report: web Bundle Diff

Generated by Rsdoctor GitHub Action

## 修改完成

对中文和英文文档都进行了以下修改:

1. **添加了 "Layout 插槽" 小标题**(英文为 "Layout Slots")- 在 `## Wrap` 部分下面的插槽说明前添加了 `### Layout 插槽` 三级标题

2. **补充了遗漏的插槽文档**:
   - `beforeNavMenu` - 导航栏菜单之前
   - `afterNav` - 导航栏之后

经过与 Layout 组件源码(`packages/core/src/theme/layout/Layout/index.tsx`)对比,现在文档中所有的 Layout 插槽都已完整:

| 插槽 | 说明 |
|------|------|
| `top` | 整个页面最顶部 |
| `bottom` | 整个页面最底部 |
| `beforeHero` | Home 页 Hero 部分之前 |
| `afterHero` | Home 页 Hero 部分之后 |
| `beforeFeatures` | Home 页 Features 部分之前 |
| `afterFeatures` | Home 页 Features 部分之后 |
| `beforeDocFooter` | 正文页 Footer 部分之前 |
| `afterDocFooter` | 正文页 Footer 部分之后 |
| `beforeDoc` | 正文页最前面 |
| `afterDoc` | 正文页最后面 |
| `beforeDocContent` | 文档内容前面 |
| `afterDocContent` | 文档内容后面 |
| `beforeNav` | 导航栏之前 |
| `afterNav` | 导航栏之后 ✅ 新增 |
| `beforeNavTitle` | 左上角导航栏标题之前 |
| `navTitle` | 导航栏标题 |
| `afterNavTitle` | 左上角导航栏标题之后 |
| `beforeNavMenu` | 导航栏菜单之前 ✅ 新增 |
| `afterNavMenu` | 导航栏菜单之后 |
| `beforeSidebar` | 左侧侧边栏上面 |
| `afterSidebar` | 左侧侧边栏下面 |
| `beforeOutline` | 右侧大纲栏上面 |
| `afterOutline` | 右侧大纲栏下面 |
| `components` | 自定义 MDX 组件 |
@SoonIter SoonIter force-pushed the vk/ca6d-guide-basic-cust branch from 2667cbb to 64991b0 Compare January 6, 2026 08:47
@SoonIter SoonIter requested a review from Timeless0911 January 6, 2026 09:51
@SoonIter SoonIter enabled auto-merge (squash) January 6, 2026 09:51
@SoonIter SoonIter merged commit 4a63cd1 into main Jan 6, 2026
8 checks passed
@SoonIter SoonIter deleted the vk/ca6d-guide-basic-cust branch January 6, 2026 10:03
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