Description
When a type: "link" inside a sidebar category points to the same URL as a generated-index page in another category, Docusaurus renders the page with items from the link's parent category instead of the generated-index's actual items.
Example
// sidebars.js
{
type: "category",
label: "Category A",
items: [
{ type: "doc", id: "doc1" },
{ type: "doc", id: "doc2" },
{
type: "link",
label: "Go to Category B →",
href: "/docs/category-b", // URL of the generated-index page
},
],
},
{
type: "category",
label: "Category B",
link: {
type: "generated-index",
slug: "/category-b",
},
items: ["item1", "item2", "item3"],
},
/docs/category-b shows cards for item1, item2, item3
But shows cards for doc1, doc2 (items from Category A)
Breadcrumb shows: Category A > Go to Category B
Note
There is no warning in the official documentation about this behavior. The docs for generated-index and type: "link" don't mention this limitation.
Description
When a
type: "link"inside a sidebar category points to the same URL as agenerated-indexpage in another category, Docusaurus renders the page with items from the link's parent category instead of the generated-index's actual items.Example
/docs/category-bshows cards for item1, item2, item3But shows cards for doc1, doc2 (items from Category A)
Breadcrumb shows: Category A > Go to Category B
Note
There is no warning in the official documentation about this behavior. The docs for
generated-indexandtype: "link"don't mention this limitation.