-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
In the sidebars.ts file, if you give multiple objects the same label (e.g., "How-to guides"), they will not generate unique translation keys. This means that the description field on those objects will not work as one of the objects will clobber all of the other ones.
As an example, let's say I want my site to look like this:
Topic A
Getting Started
...
How to guides
...
References
...
Topic B
Getting Started
...
How to guides
...
References
...
In my sidebars.ts file, I figured I could do something like this:
type: 'category',
label: 'References',
link: {
type: 'generated-index',
title: 'References',
description: 'Moderne DX reference docs.',
slug: '/administrator-documentation/moderne-dx/references',
keywords: ['reference'],
},and
type: 'category',
label: 'References',
link: {
type: 'generated-index',
title: 'References',
description: 'Moderne Platform reference docs.',
slug: '/administrator-documentation/moderne-platform/references',
keywords: ['reference'],
},However, that will result in one of the categories not having the correct description:
Related information here: #10906 (comment)
Reproducible demo
https://github.com/mike-solomon/docusaurus-testing/tree/main/website
Steps to reproduce
- Launch the side.
- Navigate to
foo/how-to. - Notice that it has the description for the
bar/how-topage.
Expected behavior
I would expect the descriptions on the category pages to match what I wrote in the sidebars.ts file.
Actual behavior
One or more of my pages descriptions gets clobbered with the incorrect description.
Your environment
- Public source code: https://github.com/moderneinc/moderne-docs
- Public site URL: https://docs.moderne.io/
- Docusaurus version used: 3.7.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Mac OS 15.3
Self-service
- I'd be willing to fix this bug myself.

