docs: update to @nuxt/content@next (#2379)

Co-authored-by: Farnabaz <farnabaz@gmail.com>
This commit is contained in:
Benjamin Canac
2024-10-31 14:16:26 +01:00
committed by GitHub
parent 8669553ea4
commit 50918a8128
16 changed files with 364 additions and 311 deletions

View File

@@ -1,7 +1,6 @@
<script setup lang="ts">
import type { NuxtError } from '#app'
import colors from 'tailwindcss/colors'
import type { ContentSearchFile } from '@nuxt/ui-pro'
import type { NuxtError } from '#app'
const props = defineProps<{
error: NuxtError
@@ -10,11 +9,9 @@ const props = defineProps<{
const route = useRoute()
const appConfig = useAppConfig()
const colorMode = useColorMode()
const runtimeConfig = useRuntimeConfig()
const { integrity, api } = runtimeConfig.public.content
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation(), { default: () => [] })
const { data: files } = await useLazyFetch<ContentSearchFile[]>(`${api.baseURL}/search${integrity ? '-' + integrity : ''}`, { default: () => [] })
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content'))
const { data: files } = await useAsyncData('files', () => queryCollectionSearchSections('content', { ignoredTags: ['style'] }))
const links = computed(() => {
return [{
@@ -22,7 +19,7 @@ const links = computed(() => {
icon: 'i-heroicons-book-open',
to: '/getting-started',
active: route.path.startsWith('/getting-started') || route.path.startsWith('/components')
}, ...(navigation.value.find(item => item._path === '/pro')
}, ...(navigation.value?.find(item => item.path === '/pro')
? [{
label: 'Pro',
icon: 'i-heroicons-square-3-stack-3d',