File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { ContentNavigationItem } from '@nuxt/content'
3
3
import { findPageChildren } from ' @nuxt/content/utils'
4
4
5
5
const route = useRoute ()
6
+ const { framework } = useSharedData ()
6
7
7
8
const navigation = inject <Ref <ContentNavigationItem []>>(' navigation' )
8
9
@@ -50,8 +51,20 @@ const categories = {
50
51
}]
51
52
}
52
53
54
+ function filterChildrenByFramework(items : ContentNavigationItem []): ContentNavigationItem [] {
55
+ return items .filter ((child ) => {
56
+ if (! child .framework ) {
57
+ return true
58
+ }
59
+
60
+ return child .framework === framework .value
61
+ })
62
+ }
63
+
53
64
function groupChildrenByCategory(items : ContentNavigationItem [], slug : string ): ContentNavigationItem [] {
54
- const childrenGroupedByCategory = items .reduce ((acc , child ) => {
65
+ const filteredItems = filterChildrenByFramework (items )
66
+
67
+ const childrenGroupedByCategory = filteredItems .reduce ((acc , child ) => {
55
68
if (child .category ) {
56
69
acc [child .category as string ] = [... (acc [child .category as string ] || []), child ]
57
70
} else {
You can’t perform that action at this time.
0 commit comments