-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Category with no items is being removed from the sidebar #7348
Comments
it is expected that draft items are removed from prod build, and that empty categories are removed too I don't understand the problem. The concept of "draft doc" is new. Please create a repro or at least give markdown file contents |
No, empty categories were not removed but converted to links if their But in 2.0.0-beta19 this behavior was changed. I believe it's a typo, but such empty categories are considered drafts and removed now.
items property is empty and every returns true .
Markdown file contents play no role, the only change from the initial skeleton is sidebars.js file. |
Thanks for the report @kolos450 you seems to have nailed the cause. Before I investigate this, PRs welcome! |
Fixed in #7385. Please try the canary version. |
…showing Bug facebook/docusaurus#7348 made categories disappear when all they had was an index.md file (or README.md) and sub-folders. Updating to canary brings them back.
Thanks - confirmed working with Canary. |
I can also confirm. Works like a charm on canary |
…showing Bug facebook/docusaurus#7348 made categories disappear when all they had was an index.md file (or README.md) and sub-folders. Updating to canary brings them back.
now released in beta.21 |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Sidebar items postprocessor nicely converted empty categories to normal links.
docusaurus/packages/docusaurus-plugin-content-docs/src/sidebars/postProcessor.ts
Line 53 in 9207caf
This behavior has been broken in 2.0.0-beta19 by the new draft documents feature.
The code below removes such items now.
docusaurus/packages/docusaurus-plugin-content-docs/src/sidebars/processor.ts
Line 93 in 9207caf
Reproducible demo
No response
Steps to reproduce
Create a new Docusaurus website,
npx create-docusaurus@latest website classic
.Use the following
sidebars.js
:Expected behavior
Two items in the sidebar.
Actual behavior
A single item in the sidebar.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: