Skip to content

Commit

Permalink
Add support for "none" category
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-ls committed Aug 12, 2024
1 parent 910f99b commit ce7b3b4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lib/output/themes/default/DefaultTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,17 @@ export class DefaultTheme extends Theme {
}

if (parent.categories && shouldShowCategories(parent, opts)) {
return filterMap(parent.categories, toNavigation);
const noneCategory = parent.categories.find((x) => x.title === "none");
const otherCategories = parent.categories.filter((x) => x.title !== "none");

const mappedOthers = filterMap(otherCategories, toNavigation);

if (noneCategory) {
const noneMappedChildren = filterMap(noneCategory.children, toNavigation);
return [...noneMappedChildren, ...mappedOthers];
}

return mappedOthers;
}

if (parent.groups && shouldShowGroups(parent, opts)) {
Expand Down

0 comments on commit ce7b3b4

Please sign in to comment.