Skip to content
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

using increasing 'sidebar_position' in each doc metadata still leads to scattered sidebar #10792

Open
6 of 7 tasks
fasakinhenry opened this issue Dec 23, 2024 · 0 comments
Open
6 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers

Comments

@fasakinhenry
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and 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

I want to use the autogenerated sidebar and didn't change much of the defaults. I just had to create a new folder in docs to create a category and add markdown files.

I noticed that I can reorder the sidebar contents under the category using the sidebar_position in the markdown meta data but once the sidebar position is over 5 it starts misbehaving and does not respond to the ordering.

---
sidebar_label: 'Separation of Concerns'
sidebar_positon: 5
---

Even more, I am now forced to use numbering in filenames which makes the docs less manageable or maintainable because a new addition that needs to be aligned amongst the already aligned involves me changing the numbering of all the others below the position which is some great manual work.

I am a beginner and I am pretty bad at automating with Javascript and I hope this can be looked into.

image

What really does happen that stops sidebar_position from having effect when the value is 5 and forces you to use numbering of filenames before it can work

Reproducible demo

No response

Steps to reproduce

  1. create a category folder
  2. Put markdown files in up to 6 0r 7
  3. add sidebar_position metatag with increasing numbers there
  4. You notice when it is beyond 5, it no longer aligns the content

Expected behavior

I just expected the sidebar_position in the metadata for each markdown to help in ordering the sidebar

Actual behavior

the sidebar_position does not organize elements in the sidebar

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.
@fasakinhenry fasakinhenry added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant