Skip to content

Commit ada5954

Browse files
committed
doc: nuxt content v3 fixes
1 parent 329d77a commit ada5954

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2327
-2513
lines changed

docs/app.vue

-80
This file was deleted.
File renamed without changes.

docs/app/app.vue

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<script setup lang="ts">
2+
function recursiveContentFix(data: any) {
3+
if (data.id && !data.path) {
4+
data.path = data.id
5+
}
6+
data.to = data.path
7+
data.label = data.title
8+
if (data.children) {
9+
data.children = data.children.map((nav) => {
10+
return recursiveContentFix(nav)
11+
})
12+
}
13+
return data
14+
}
15+
16+
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'), {
17+
transform(data) {
18+
return data.map(data => recursiveContentFix(data))
19+
},
20+
})
21+
22+
const { data: files } = await useAsyncData('search', () => queryCollectionSearchSections('docs'), {
23+
transform(data) {
24+
return data.map(data => recursiveContentFix(data))
25+
},
26+
})
27+
28+
provide('navigation', computed(() => {
29+
return navigation.value || []
30+
}))
31+
provide('topGuides', computed(() => {
32+
return (navigation.value || [])?.[0]?.children?.find(nav => nav.title === 'Guides')?.children || []
33+
}))
34+
</script>
35+
36+
<template>
37+
<div class="bg-white dark:bg-gray-950">
38+
<NuxtLoadingIndicator color="#FFF" />
39+
40+
<Header />
41+
42+
<NuxtLayout>
43+
<NuxtPage />
44+
</NuxtLayout>
45+
46+
<Footer />
47+
48+
<ClientOnly>
49+
<LazyContentSearch
50+
:files="files"
51+
:navigation="navigation"
52+
:fuse="{ resultLimit: 42 }"
53+
/>
54+
</ClientOnly>
55+
<UNotifications />
56+
</div>
57+
</template>
58+
59+
<style>
60+
body {
61+
font-family: 'Inter var experimental', 'Inter var', 'Inter', sans-serif;
62+
}
63+
</style>

0 commit comments

Comments
 (0)