-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
fix(content-docs): always sort autogenerated sidebar items by file/folder name by default #6700
Conversation
✔️ [V2] 🔨 Explore the source changes: e761d09 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/62205b5ec3934a0008a15563 😎 Browse the preview: https://deploy-preview-6700--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6700--docusaurus-2.netlify.app/ |
Size Change: 0 B Total Size: 789 kB ℹ️ View Unchanged
|
Okay, this is not easy to design... What should happen if some items have positions but others don't? Should we use file names, or customized labels if they exist? Should we be future-proof and take HTML items or link items into account? |
ee685ea
to
9c7aab9
Compare
105e8fd
to
62ddcd5
Compare
This PR introduces slight behavior inconsistencies, but it's considered a bug fix and not a breaking change.
|
ok, that seems to work, comparing these 2 URLs I can see the change:
Going to merge but 🤷♂️ I don't know if this is really useful. Why not sort by sidebar item label (if any) instead of source. Also it's preferable to add a new test case instead of modifying test+snapshot+impl. It's complicated for me to review if everything changes at once, and hard to notice possible regressions |
Existing test cases are actually bad, because they have colliding sidebar positions. I merely fixed them so that the snapshots stay the same. The only changed one was the undeterministic one |
If we are starting from scratch I'd agree with that, but this "alphabetical order by file/folder name" has always been the behavior and documented, so I'd prefer to leave it as-is 😄 |
Thanks Didn't know we documented this actually 😅 |
Motivation
Fix #6698
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan