diff --git a/docs/app/app.vue b/docs/app/app.vue index 11eb2264..1f3e2a46 100644 --- a/docs/app/app.vue +++ b/docs/app/app.vue @@ -73,33 +73,10 @@ useServerSeoMeta({ twitterCard: 'summary_large_image' }) -const { framework, frameworks } = useSharedData() +const { frameworks } = useSharedData() +const { mappedNavigation, filteredNavigation } = useContentNavigation(navigation) -function filterFrameworkItems(items: any[]) { - return items?.filter(item => !item.framework || item.framework === framework.value) -} - -function processNavigationItem(item: any): any { - if (item.shadow) { - const matchingChild = filterFrameworkItems(item.children)?.[0] - return matchingChild - ? { - ...matchingChild, - title: item.title, - children: matchingChild.children ? processNavigationItem(matchingChild) : undefined - } - : item - } - - return { - ...item, - children: item.children?.length ? filterFrameworkItems(item.children)?.map(processNavigationItem) : undefined - } -} - -const filteredNavigation = computed(() => navigation.value?.map(processNavigationItem)) - -provide('navigation', filteredNavigation) +provide('navigation', mappedNavigation)