diff --git a/docs/app.vue b/docs/app.vue index fec4adfa..d8b7c1bb 100644 --- a/docs/app.vue +++ b/docs/app.vue @@ -51,7 +51,7 @@ const navigation = computed(() => { ] } - return nav.value.filter(item => item._path !== '/dev') + return nav.value?.filter(item => item._path !== '/dev') || [] }) const color = computed(() => colorMode.value === 'dark' ? '#18181b' : 'white') diff --git a/docs/error.vue b/docs/error.vue index 1248b82c..09486949 100644 --- a/docs/error.vue +++ b/docs/error.vue @@ -1,3 +1,4 @@ + @@ -34,6 +42,7 @@ defineProps<{ }>() const route = useRoute() +const colorMode = useColorMode() const { branch } = useContentSource() const { data: nav } = await useAsyncData('navigation', () => fetchContentNavigation()) @@ -52,9 +61,11 @@ const navigation = computed(() => { ] } - return nav.value.filter(item => item._path !== '/dev') + return nav.value?.filter(item => item._path !== '/dev') || [] }) +const color = computed(() => colorMode.value === 'dark' ? '#18181b' : 'white') + const links = computed(() => { return [{ label: 'Docs', @@ -65,7 +76,7 @@ const links = computed(() => { label: 'Pro', icon: 'i-heroicons-square-3-stack-3d', to: '/pro', - active: route.path.startsWith('/pro/getting-started') || route.path.startsWith('/pro/components') + active: route.path.startsWith('/pro/getting-started') || route.path.startsWith('/pro/components') || route.path.startsWith('/pro/prose') }, { label: 'Pricing', icon: 'i-heroicons-credit-card', @@ -81,6 +92,21 @@ const links = computed(() => { }].filter(Boolean) }) +// Head + +useHead({ + meta: [ + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { key: 'theme-color', name: 'theme-color', content: color } + ], + link: [ + { rel: 'icon', type: 'image/svg+xml', href: '/icon.svg' } + ], + htmlAttrs: { + lang: 'en' + } +}) + // Provide provide('navigation', navigation)