Skip to content

Commit ce7b3b4

Browse files
committed
Add support for "none" category
1 parent 910f99b commit ce7b3b4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/lib/output/themes/default/DefaultTheme.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,17 @@ export class DefaultTheme extends Theme {
383383
}
384384

385385
if (parent.categories && shouldShowCategories(parent, opts)) {
386-
return filterMap(parent.categories, toNavigation);
386+
const noneCategory = parent.categories.find((x) => x.title === "none");
387+
const otherCategories = parent.categories.filter((x) => x.title !== "none");
388+
389+
const mappedOthers = filterMap(otherCategories, toNavigation);
390+
391+
if (noneCategory) {
392+
const noneMappedChildren = filterMap(noneCategory.children, toNavigation);
393+
return [...noneMappedChildren, ...mappedOthers];
394+
}
395+
396+
return mappedOthers;
387397
}
388398

389399
if (parent.groups && shouldShowGroups(parent, opts)) {

0 commit comments

Comments
 (0)