diff --git a/.changeset/fast-bulldogs-grab.md b/.changeset/fast-bulldogs-grab.md new file mode 100644 index 00000000..570e77db --- /dev/null +++ b/.changeset/fast-bulldogs-grab.md @@ -0,0 +1,5 @@ +--- +'@jpmorganchase/mosaic-plugins': patch +--- + +Fix pages that are excluded from the sidebar having no sidebar diff --git a/packages/plugins/src/SidebarPlugin.ts b/packages/plugins/src/SidebarPlugin.ts index 71a1f1be..1ee2ba29 100644 --- a/packages/plugins/src/SidebarPlugin.ts +++ b/packages/plugins/src/SidebarPlugin.ts @@ -245,9 +245,9 @@ const SidebarPlugin: PluginType { const sidebarFilePath = path.posix.join(String(rootDir), filename); - let pages = await createPageList(rootDir); - pages = pages.filter(page => removeExcludedPages(page)); - const groupMap = createGroupMap(pages); + const pages = await createPageList(rootDir); + const includedPages = pages.filter(page => removeExcludedPages(page)); + const groupMap = createGroupMap(includedPages); const sidebarData = linkGroupMap(groupMap, rootDir); if (sidebarData[0] === undefined) {