Skip to content

Commit e83be38

Browse files
authored
fix(sidebar): hide release_notes directory and backup_recovery from autogenerated sidebar (#58)
With autogenerated sidebars, Docusaurus creates a separate category entry for the release_notes/ directory in addition to the release_notes.md page, resulting in a duplicate and broken "release_notes" entry in the navigation menu. The legacy backup_recovery stub page also appears in the sidebar but should not, as its content has been split into separate backup and recovery pages. Add a custom sidebarItemsGenerator that filters out both entries while keeping the pages accessible via direct links. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent a5bc777 commit e83be38

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

website/docusaurus.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ 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+
return items.filter((item) => {
56+
// Remove the release_notes directory category from the sidebar
57+
if (item.type === 'category' && item.label === 'release_notes') return false;
58+
// Remove the legacy backup_recovery stub page from the sidebar
59+
if (item.type === 'doc' && item.id === 'backup_recovery') return false;
60+
return true;
61+
});
62+
},
5363
},
5464
blog: false,
5565
theme: {

0 commit comments

Comments
 (0)