We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59c69bc commit d529996Copy full SHA for d529996
src/runtime/internal/surround.ts
@@ -17,10 +17,10 @@ export async function generateItemSurround<T extends PageCollectionItemBase>(que
17
] as ContentNavigationItem[]
18
}
19
20
-function flattedData(data: ContentNavigationItem[]) {
+export 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)) {
+ if (item.page === false || (children.length && children.find(c => c.path === item.path))) {
24
return children
25
26
0 commit comments