Skip to content

[Bug]: Excluded routes still appear in the no-config sidebars #848

@Tyneor

Description

@Tyneor

Version

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz
    Memory: 2.99 GB / 15.69 GB
  Browsers:
    Chrome: 121.0.6167.185
    Edge: Chromium (122.0.2365.92)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    rspress: ^1.0.0 => 1.15.1

Details

I added the following lines to the rspress.config.ts :

route: {
    exclude: ["assets/**/*", "**/4-ignore.*"],
  },

expecting all assets in /docs and the 4-ignore.md not to have routes created for them and not appear in sidebars.

The routes are indeed not created but they still appear in the sidebar:

image

I don't really know if this is a bug but I would say that no-config sidebars should not display non-existing pages.

Reproduce link

https://codesandbox.io/p/devbox/minimal-route-exclude-in-sidebar-reproduction-gwzr65?file=%2Frspress.config.ts

Reproduce Steps

  1. remove _meta.jsonin docs/guide
  2. add assets in docs/guide/assets/
  3. add some markdown files in /docs/guide including 4-ignore.md
  4. in rspress.config.ts add
route: {
    exclude: ["assets/**/*", "**/4-ignore.*"],
  },
  1. the assets and the Ignore route still appear in the guide sidebar

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions