Skip to content

Commit

Permalink
docs(app): transform navigation to improve search
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Nov 22, 2024
1 parent 4676e51 commit d24e76c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { withoutTrailingSlash } from 'ufo'
const route = useRoute()
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'))
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'), {
transform: (data) => data.find(item => item.path === '/docs')?.children || [],

Check failure on line 7 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ubuntu

Unexpected parentheses around single function argument having a body with no curly braces
})
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
server: false,
})
Expand Down
4 changes: 1 addition & 3 deletions docs/app/layouts/docs.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup lang="ts">
import type { ContentNavigationItem } from '@nuxt/content'
const nav = inject<Ref<ContentNavigationItem[]>>('navigation')
const navigation = computed(() => nav?.value?.find(item => item.path === '/docs')?.children || [])
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
</script>

<template>
Expand Down
1 change: 0 additions & 1 deletion docs/content/docs/.navigation.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

title: Documentation

0 comments on commit d24e76c

Please sign in to comment.