Skip to content

Commit 2ffdca6

Browse files
committed
fix(sidebar): hide release_notes directory from autogenerated sidebar
With autogenerated sidebars, Docusaurus creates a separate category entry for the release_notes/ directory in addition to the release_notes.md page. This results in a duplicate and broken "release_notes" entry in the navigation menu. Add a custom sidebarItemsGenerator that filters out the release_notes directory category while keeping the individual pages accessible via links in the Release notes index page. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent a5bc777 commit 2ffdca6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

website/docusaurus.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ const config: Config = {
5050
includeCurrentVersion: true, // Include the current version in the sidebar
5151
lastVersion: lastVersion,
5252
versions: versionsConfig,
53+
async sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}) {
54+
const items = await defaultSidebarItemsGenerator(args);
55+
// Remove the release_notes directory category from the sidebar.
56+
// Individual release note pages are still accessible via links
57+
// in the release_notes.md index page.
58+
return items.filter(
59+
(item) => !(item.type === 'category' && item.label === 'release_notes'),
60+
);
61+
},
5362
},
5463
blog: false,
5564
theme: {

0 commit comments

Comments
 (0)