Skip to content

fix(website): restore sidebar for guide/config sections#554

Merged
fansenze merged 1 commit intomainfrom
fix/website-sidebar-20260320
Mar 20, 2026
Merged

fix(website): restore sidebar for guide/config sections#554
fansenze merged 1 commit intomainfrom
fix/website-sidebar-20260320

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

Summary

The rule-manifest plugin's config hook was setting themeConfig.sidebar and themeConfig.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.json were silently dropped.

This PR replaces the config/addPages approach with beforeBuild file generation: the plugin now writes rule .mdx files and _meta.json into docs/en/rules/<group>/, letting Rspress auto-sidebar handle all sections uniformly. Each generated .mdx imports <RuleConfig> via the @/ alias instead of relying on globalComponents.

Related Links

  • Root cause: auto_nav_sidebar_haveNavSidebarConfig() in Rspress skips auto-generation when themeConfig.nav or themeConfig.sidebar is set by a plugin.

Checklist

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

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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

  • Sidebar Generation Fix: The rule-manifest plugin was refactored to prevent it from overriding Rspress's auto-sidebar generation, which previously caused the /guide/ and /config/ sections to lose their sidebars.
  • Plugin Architecture Change: The plugin now uses a beforeBuild hook to generate rule documentation .mdx files and _meta.json files directly into the docs/en/rules/ directory, allowing Rspress to handle sidebar generation uniformly across all sections.
  • RuleConfig Component Handling: The <RuleConfig> component is no longer registered as a global MDX component; instead, each generated rule .mdx file explicitly imports it using an @/ alias.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.
@fansenze fansenze force-pushed the fix/website-sidebar-20260320 branch from 13f6ca8 to fa83f62 Compare March 20, 2026 04:38
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 20, 2026

Deploying rslint with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa83f62
Status: ✅  Deploy successful!
Preview URL: https://495936eb.rslint.pages.dev
Branch Preview URL: https://fix-website-sidebar-20260320.rslint.pages.dev

View logs

@fansenze fansenze merged commit 0985984 into main Mar 20, 2026
15 checks passed
@fansenze fansenze deleted the fix/website-sidebar-20260320 branch March 20, 2026 05:38
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.

2 participants