-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
For a non-category doc page, the front matter sidebar_class_name doesn't work if the file is organized as xxx/index.md[x], while it works as expected when the doc is xxx.md[x].
Related issue: #10864
Reproducible demo
Steps to reproduce
The first four steps are implemented in the provided CodeSandbox.
- Create a new docusaurus project.
- Go to
docs/tutorial-basics/create-a-document.md, addsidebar_class_name: this-worksand see it works. - Add a new file
docs/foo/index.mdwithsidebar_class_name: abcdeand see it doesn't apply. - Add a new file
docs/tutorial-basics/bar/index.mdwithsidebar_class_name: abcdeand see it doesn't apply either.
sidebar_class_name does work on "category" index pages:
- Go to
docs/tutorial-basics/_category_.json, remove the"link"entry. Add a new filedocs/tutorial-basics/index.mdwithsidebar_class_name: this-works-tooand see it works.
Expected behavior
sidebar_class_name ("abcde") applied to the sidebar items.
Actual behavior
sidebar_class_name doesn't apply.
Your environment
- Docusaurus version used: 3.8.0/3.8.1
Self-service
- I'd be willing to fix this bug myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution