We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f8f128 commit 5810fc6Copy full SHA for 5810fc6
src/runtime/internal/surround.ts
@@ -20,8 +20,11 @@ export async function generateItemSurround<T extends PageCollectionItemBase>(que
20
function flattedData(data: ContentNavigationItem[]) {
21
const flatData = data.flatMap((item) => {
22
const children: ContentNavigationItem[] = item.children ? flattedData(item.children) : []
23
+ if (item.page === false || (children.length && children[0].path === item.path)) {
24
+ return children
25
+ }
26
- return item.page === false ? children : [{ ...item, children: undefined }, ...children]
27
+ return [{ ...item, children: undefined }, ...children]
28
})
29
30
return flatData
0 commit comments