fix(website): restore sidebar for guide/config sections#554
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where the website's documentation was failing to display sidebars for the guide and configuration sections. The underlying cause was a plugin that inadvertently disabled Rspress's automatic sidebar generation. The fix involves a significant refactoring of the plugin to pre-generate documentation files and their metadata, ensuring that Rspress can correctly and uniformly build navigation across all documentation parts. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the website's rule manifest plugin to fix an issue where auto-generated sidebars for /guide/ and /config/ sections were being dropped. The new approach of generating rule documentation files on disk during the beforeBuild step and letting Rspress handle sidebar generation is a significant improvement over the previous method of manually injecting sidebar configuration. The changes are well-structured and effectively solve the problem. I've included a few suggestions to improve the robustness of the file generation and cleanup logic, as well as to enhance type safety.
…r override The rule-manifest plugin's config hook was setting themeConfig.sidebar and themeConfig.nav, which disabled Rspress's auto-sidebar generation for the entire site. Only the /rules/ sidebar was present; /guide/ and /config/ sidebars from _meta.json were silently dropped. Replace the config/addPages approach with beforeBuild file generation: the plugin now writes rule .mdx files and _meta.json to docs/en/rules/, letting Rspress auto-sidebar handle all sections uniformly. Each .mdx imports <RuleConfig> via the @/ alias instead of relying on globalComponents.
13f6ca8 to
fa83f62
Compare
Deploying rslint with
|
| Latest commit: |
fa83f62
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://495936eb.rslint.pages.dev |
| Branch Preview URL: | https://fix-website-sidebar-20260320.rslint.pages.dev |
Summary
The rule-manifest plugin's
confighook was settingthemeConfig.sidebarandthemeConfig.nav, which caused Rspress to skip its auto-sidebar generation entirely. As a result, only the/rules/sidebar was present — the/guide/and/config/sidebars configured via_meta.jsonwere silently dropped.This PR replaces the
config/addPagesapproach withbeforeBuildfile generation: the plugin now writes rule.mdxfiles and_meta.jsonintodocs/en/rules/<group>/, letting Rspress auto-sidebar handle all sections uniformly. Each generated.mdximports<RuleConfig>via the@/alias instead of relying onglobalComponents.Related Links
auto_nav_sidebar_haveNavSidebarConfig()in Rspress skips auto-generation whenthemeConfig.navorthemeConfig.sidebaris set by a plugin.Checklist