-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
fix(docs): add support for missing sidebar_key front matter attribute
#11490
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: +10.6 kB (+0.09%) Total Size: 11.8 MB
ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
7 tasks
|
Size Change: +10.7 kB (+0.09%) Total Size: 12.2 MB
ℹ️ View Unchanged
|
slorber
added a commit
that referenced
this pull request
Oct 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In Docusaurus v3.9, we added the ability to assign custom translation keys to sidebar items:
keyattribute - fix docs translations key conflicts #11228Unfortunately, support wasn't "complete", leading to DX problems: #11458
For category indexes linking to a doc (
Category/index.mdx), if the category has the same name as another, it requires fixing the conflict by adding a_category_.jsonfile with akeyattribute. This is ok, but not ideal to require creating that file just to assign a key, while we usually forward the othersidebar_*key attributes to the corresponding category item.For this reason, I'm also adding the
sidebar_keyattribute so that the user can use it directly insideCategory/index.mdxfront matter, without creating an additional file.I'm also improving the translation key conflict error message to make it clearer that:
_category_.jsonsupports thekeyattributeCategory/index.mdxsupports thesidebar_keyfront matterAll this should help increase the DX, and ease adoption of v3.9
Since I forgot to add support for
sidebar_keyin the initial release, I'm going to consider this a bug fix, and not a new feature.Test Plan
Unit tests + dogfood test + preview
Test links
https://deploy-preview-11490--docusaurus-2.netlify.app/tests/docs/category/category-index-name-conflict-2/