Skip to content

Commit 0d112f2

Browse files
committed
sort auto-sidebar folders to the bottom
1 parent 44dec4b commit 0d112f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/project/types/website/website-sidebar-auto.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ async function nodesToEntries(
171171
const titleOrder = a.title.toLocaleUpperCase().localeCompare(
172172
b.title.toLocaleUpperCase(),
173173
);
174+
if (a.children && !b.children) {
175+
return 1;
176+
} else if (b.children && !a.children) {
177+
return -1;
178+
}
174179
if (a.order !== undefined && b.order !== undefined) {
175180
const order = a.order - b.order;
176181
return order !== 0 ? order : titleOrder;

0 commit comments

Comments
 (0)