11<script setup lang="ts">
22import { withoutTrailingSlash } from ' ufo'
3- import colors from ' tailwindcss/colors'
43
54const route = useRoute ()
6- const appConfig = useAppConfig ()
7- const colorMode = useColorMode ()
85
96const { data : navigation } = await useAsyncData (' navigation' , () => queryCollectionNavigation (' docs' ))
107const { data : files } = useLazyAsyncData (' search' , () => queryCollectionSearchSections (' docs' ), {
118 server: false ,
129})
1310
14- const searchTerm = ref (' ' )
15-
16- // watch(searchTerm, debounce((query: string) => {
17- // if (!query) {
18- // return
19- // }
20-
21- // useTrackEvent('Search', { props: { query: `${query} - ${searchTerm.value?.commandPaletteRef.results.length} results` } })
22- // }, 500))
23-
24- const links = computed (() => {
25- return [{
26- label: ' Docs' ,
27- icon: ' i-lucide-book' ,
28- to: ' /docs/getting-started' ,
29- active: route .path .startsWith (' /docs' ),
30- }].filter (Boolean )
31- })
32-
33- const color = computed (() => colorMode .value === ' dark' ? colors [appConfig .ui .colors .neutral as keyof typeof colors ][900 ] : ' white' )
11+ const links = useNavLinks ()
12+ const color = useThemeColor ()
3413
3514useHead ({
3615 meta: [
@@ -39,7 +18,7 @@ useHead({
3918 ],
4019 link: [
4120 { rel: ' icon' , type: ' image/svg+xml' , href: ' /icon.svg' },
42- { rel: ' canonical' , href: ` https://content .nuxt.com ${withoutTrailingSlash (route .path )} ` },
21+ { rel: ' canonical' , href: ` https://content3 .nuxt.dev ${withoutTrailingSlash (route .path )} ` },
4322 ],
4423 htmlAttrs: {
4524 lang: ' en' ,
@@ -69,7 +48,6 @@ provide('navigation', navigation)
6948
7049 <ClientOnly >
7150 <LazyUContentSearch
72- v-model:search-term =" searchTerm"
7351 :files =" files"
7452 :navigation =" navigation"
7553 :fuse =" { resultLimit: 42 }"
0 commit comments