Repository navigation
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
There is a bug in the documentation structure where the link for an category in one folder is replacing the link for a category in another folder, despite them being in completely different locations. This happens when the category label is the same.
This results in incorrect category attributes displayed in the generated index pages.
Reproducible demo
https://codesandbox.io/p/devbox/lucid-northcutt-8lp9z5
Steps to reproduce
-
Ensure that the sidebar is autogenerated in sidebars.js from the root
docs/folder -
Create two folders
AlphaandBetain thedocs/folder. In each folder, create atestfolder and a sampletest.mdfile without content inside. We have the following configuration :
docs/
alpha/
test/
test.md
beta/
test/
test.md
- Create a category file _category_.json in
docs/alphawith the following content :
{
"label": "Alpha",
"link": {
"type": "generated-index"
}
}- Create a category file _category_.json in
docs/betawith the following content :
{
"label": "Beta",
"link": {
"type": "generated-index"
}
}- Create a category file _category_.json in
docs/alpha/testwith the following content:
{
"label": "CategoryLabelTest",
"link": {
"type": "generated-index",
"title": "test category in Alpha",
"description" : "Test description in Alpha"
}
}- Create a category file _category_.json in
docs/beta/testwith the following content:
{
"label": "CategoryLabelTest",
"link": {
"type": "generated-index",
"title": "test category in Beta",
"description" : "Test description in Beta"
}
}Final docs/ directory structure is the following :
docs/
alpha/
_category_.json
test/
test.md
_category_.json
beta/
_category_.json
test/
test.md
_category_.json
Expected behavior
Each link in different categories should keep their own distinct attributes.
Actual behavior
Based on the previous example, the link title in docs/beta/test/_category_.json is overriding the title in docs/alpha/test/_category_.json. Same for the description.
Moreover, URL becomes docs/category/categorylabeltest and docs/category/categorylabeltest-1 instead of expected respectively docs/category/alpha/categorylabeltest and docs/category/beta/categorylabeltest
Your environment
- Docusaurus version used : 3.8.0
- Environment name and version : Firefox 139.0.1, Node 22.14.0
- Operating system and version : Windows 11 24H2
Self-service
- I'd be willing to fix this bug myself.



Activity
slorber commentedon Jun 2, 2025
Yes this looks like a bug, probably a naming collision in JSON modules we emit. I wonder if this is related to #11136 or a different one.
This behavior is expected.
Category index URLs follow the
/category/${slug(category.label)}pattern by default, and do not include any parent category label.You can override/customize it with the
link.slugattribute:https://docusaurus.io/docs/next/sidebar/items#generated-index-page
slorber commentedon Jun 4, 2025
It's due to our i18n system creating duplicate translation keys.
I'll see how to fix it, or at least ensure it doesn't affect sites that do not use i18n by default.
Duplicate of #10913
Bump docusaurus version to canary release to address meta/docusaurus#…