feat(docs): 初始化 GFramework 文档网站配置#194
Conversation
- 添加 VitePress 主题样式文件,自定义颜色、按钮、首页、自定义块等组件样式 - 配置深蓝色品牌色彩方案,包括文字、悬停和背景色 - 实现首页英雄区域渐变效果和响应式图像模糊滤镜 - 集成本地搜索功能,支持中文界面翻译和搜索提示 - 创建安全泛型转义插件,防止 Markdown 中的尖括号被误解析 - 设置多语言导航菜单,包含入门指南、Core、Game、Godot 等模块链接 - 构建完整的侧边栏结构,覆盖核心框架、游戏模块、源码生成器等所有功能区域 - 配置教程、最佳实践、API参考等学习资源分类 - 添加页脚版权信息、社交链接和返回顶部功能 - 优化移动端和桌面端的搜索框显示适配
📝 WalkthroughWalkthroughVitePress 配置和样式调整:提取可复用的本地搜索配置对象,集中管理搜索和中文UI翻译;重新组织导航菜单项位置;添加响应式CSS规则以适配不同屏幕尺寸下的导航栏布局。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
审阅者指南为 GFramework 的 VitePress 文档配置共享的本地搜索设置,重构中文导航,将高级部分归组到「更多」菜单下,并调整导航栏 CSS,使搜索控件在中、大尺寸桌面断点下始终可见且尺寸一致。 VitePress 文档中共享本地搜索配置的类图classDiagram
class VitePressConfig {
+locales
+themeConfig
+markdown
+vite
}
class LocalSearchConfig {
+provider
+options
}
class LocalSearchOptions {
+translations
}
class SearchTranslations {
+buttonText
+buttonAriaLabel
+noResultsText
+resetButtonTitle
+selectText
+navigateText
+closeText
}
class ThemeConfig {
+logo
+search
+nav
}
class RootLocale {
+label
+lang
+link
+themeConfig
}
VitePressConfig "1" o-- "1" LocalSearchConfig : localSearch
VitePressConfig "1" o-- "1" ThemeConfig : themeConfig
VitePressConfig "1" o-- "*" RootLocale : locales
ThemeConfig "1" *-- "1" LocalSearchConfig : search
RootLocale "1" o-- "1" ThemeConfig : themeConfig
LocalSearchConfig "1" o-- "1" LocalSearchOptions : options
LocalSearchOptions "1" o-- "1" SearchTranslations : translations
响应式导航栏搜索行为的流程图flowchart LR
A[Viewport_width_change] --> B{Width_range}
B -->|<768px| C[Default_VitePress_navbar_behavior]
B -->|768px_to_1279px| D[Apply_medium_navbar_rules]
B -->|>=1280px| E[Apply_large_navbar_rules]
D --> D1[Keep_VPNavBarSearch_visible_with_fixed_padding]
D --> D2[Hide_keyboard_shortcut_keys_label]
D --> D3[Compress_nav_links_font_size_and_padding]
E --> E1[Reserve_min_width_for_search_button]
E --> E2[Stretch_search_button_for_stable_layout]
文件级变更
技巧与命令与 Sourcery 交互
自定义你的使用体验打开你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's GuideConfigures shared local search settings for the GFramework VitePress docs, restructures the Chinese navigation to group advanced sections under a “更多” menu, and adjusts navbar CSS so the search control remains visible and consistently sized across medium and large desktop breakpoints. Class diagram for shared local search configuration in VitePress docsclassDiagram
class VitePressConfig {
+locales
+themeConfig
+markdown
+vite
}
class LocalSearchConfig {
+provider
+options
}
class LocalSearchOptions {
+translations
}
class SearchTranslations {
+buttonText
+buttonAriaLabel
+noResultsText
+resetButtonTitle
+selectText
+navigateText
+closeText
}
class ThemeConfig {
+logo
+search
+nav
}
class RootLocale {
+label
+lang
+link
+themeConfig
}
VitePressConfig "1" o-- "1" LocalSearchConfig : localSearch
VitePressConfig "1" o-- "1" ThemeConfig : themeConfig
VitePressConfig "1" o-- "*" RootLocale : locales
ThemeConfig "1" *-- "1" LocalSearchConfig : search
RootLocale "1" o-- "1" ThemeConfig : themeConfig
LocalSearchConfig "1" o-- "1" LocalSearchOptions : options
LocalSearchOptions "1" o-- "1" SearchTranslations : translations
Flow diagram for responsive navbar search behaviorflowchart LR
A[Viewport_width_change] --> B{Width_range}
B -->|<768px| C[Default_VitePress_navbar_behavior]
B -->|768px_to_1279px| D[Apply_medium_navbar_rules]
B -->|>=1280px| E[Apply_large_navbar_rules]
D --> D1[Keep_VPNavBarSearch_visible_with_fixed_padding]
D --> D2[Hide_keyboard_shortcut_keys_label]
D --> D3[Compress_nav_links_font_size_and_padding]
E --> E1[Reserve_min_width_for_search_button]
E --> E2[Stretch_search_button_for_stable_layout]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| C# | Apr 7, 2026 6:27a.m. | Review ↗ | |
| Secrets | Apr 7, 2026 6:27a.m. | Review ↗ |
There was a problem hiding this comment.
Hey - 我已经审查了你的改动,一切看起来都很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的审查。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
docs/.vitepress/config.mts (1)
111-113: 建议统一source-generators链接风格(补齐末尾/)。Line 112 当前是
/zh-CN/source-generators,而同模块侧边栏使用/zh-CN/source-generators/。建议统一为目录页风格,减少潜在重定向与导航激活态不一致。建议修改
- { text: '源码生成器', link: '/zh-CN/source-generators' }, + { text: '源码生成器', link: '/zh-CN/source-generators/' },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/.vitepress/config.mts` around lines 111 - 113, The link entry for '源码生成器' in the nav config uses '/zh-CN/source-generators' without a trailing slash, causing inconsistency with the sidebar path '/zh-CN/source-generators/'; update the nav item (the object with text '源码生成器' and link '/zh-CN/source-generators') to use '/zh-CN/source-generators/' so the directory-style URL is consistent across navigation and avoids redirect/active-state mismatches.docs/.vitepress/theme/style.css (1)
167-176: 可选:提取搜索宽度常量,避免重复魔法数。Line 170 与 Line 175 重复
176px,后续若改宽度需要双点维护。可抽成 CSS 变量。建议修改
+ :root { + --vp-nav-search-min-width: 176px; + } `@media` (min-width: 1280px) { /* Reserve stable room for the search button before appearance and social actions appear. */ .VPNavBarSearch { - min-width: 176px; + min-width: var(--vp-nav-search-min-width); } .VPNavBarSearch .VPNavBarSearchButton { justify-content: space-between; - min-width: 176px; + min-width: var(--vp-nav-search-min-width); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/.vitepress/theme/style.css` around lines 167 - 176, The CSS repeats the magic value "176px" in the media query for .VPNavBarSearch and .VPNavBarSearch .VPNavBarSearchButton; define a single CSS variable (e.g., --vp-search-min-width) either at :root or at the same `@media` block and replace both hard-coded values with var(--vp-search-min-width) so future changes require a single edit and maintain a fallback if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/.vitepress/config.mts`:
- Around line 111-113: The link entry for '源码生成器' in the nav config uses
'/zh-CN/source-generators' without a trailing slash, causing inconsistency with
the sidebar path '/zh-CN/source-generators/'; update the nav item (the object
with text '源码生成器' and link '/zh-CN/source-generators') to use
'/zh-CN/source-generators/' so the directory-style URL is consistent across
navigation and avoids redirect/active-state mismatches.
In `@docs/.vitepress/theme/style.css`:
- Around line 167-176: The CSS repeats the magic value "176px" in the media
query for .VPNavBarSearch and .VPNavBarSearch .VPNavBarSearchButton; define a
single CSS variable (e.g., --vp-search-min-width) either at :root or at the same
`@media` block and replace both hard-coded values with var(--vp-search-min-width)
so future changes require a single edit and maintain a fallback if needed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e0e3b7f4-9d5d-4c4b-a856-8999fa105983
📒 Files selected for processing (2)
docs/.vitepress/config.mtsdocs/.vitepress/theme/style.css
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (C#)
- GitHub Check: Code Quality & Security
- GitHub Check: Build and Test
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-06T10:00:34.101Z
Learning: Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change
📚 Learning: 2026-04-06T10:00:34.101Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-06T10:00:34.101Z
Learning: Applies to docs/zh-CN/**/*.md : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change
Applied to files:
docs/.vitepress/config.mts
🔇 Additional comments (3)
docs/.vitepress/config.mts (2)
3-22: 抽离localSearch配置是正确的可维护性改进。Line 3-22 将搜索配置集中复用,减少了后续中英文文案和 provider 配置漂移风险。
86-89: 顶层与 locale 同步挂载搜索配置的处理合理。Line 86-89 与 Line 99 同时指向
localSearch,能避免不同配置入口读取差异导致的搜索入口缺失。Also applies to: 99-99
docs/.vitepress/theme/style.css (1)
139-177: 导航响应式策略实现到位。Line 139-177 对中屏与大屏分别处理搜索区和菜单密度,能直接改善导航可用性与稳定性。
Summary by Sourcery
为基于 VitePress 的 GFramework 文档站点配置并优化导航与搜索行为。
增强内容:
文档相关:
Original summary in English
Summary by Sourcery
Configure and refine the documentation site navigation and search behavior for the GFramework VitePress-powered docs.
Enhancements:
Documentation:
Summary by CodeRabbit
更新说明