docs(app): improve links

This commit is contained in:
Benjamin Canac
2024-11-07 16:25:01 +01:00
parent 42fce998e4
commit 8059d540e3
7 changed files with 49 additions and 62 deletions

View File

@@ -20,33 +20,26 @@ const searchTerm = ref('')
// useTrackEvent('Search', { props: { query: `${query} - ${searchTerm.value?.commandPaletteRef.results.length} results` } })
// }, 500))
const links = computed(() => {
return [{
label: 'Docs',
icon: 'i-lucide-book-open',
to: '/getting-started',
active: route.path.startsWith('/getting-started') || route.path.startsWith('/components')
}, ...(navigation.value?.find(item => item.path === '/pro')
? [{
label: 'Pro',
icon: 'i-lucide-layers-3',
to: '/pro',
active: route.path.startsWith('/pro/getting-started') || route.path.startsWith('/pro/components') || route.path.startsWith('/pro/prose')
}, {
label: 'Pricing',
icon: 'i-lucide-credit-card',
to: '/pro/pricing'
}, {
label: 'Templates',
icon: 'i-lucide-monitor',
to: '/pro/templates'
}]
: []), {
label: 'Releases',
icon: 'i-lucide-rocket',
to: '/releases'
}].filter(Boolean)
})
const links = computed(() => [{
label: 'Docs',
icon: 'i-lucide-book-open',
to: '/getting-started',
active: route.path.startsWith('/getting-started')
}, {
label: 'Components',
icon: 'i-lucide-box',
to: '/components',
active: route.path.startsWith('/components')
}, {
label: 'Roadmap',
icon: 'i-lucide-map',
to: '/roadmap'
}, {
label: 'Releases',
icon: 'i-lucide-rocket',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
}].filter(Boolean))
const color = computed(() => colorMode.value === 'dark' ? (colors as any)[appConfig.ui.colors.neutral][900] : 'white')
const radius = computed(() => `:root { --ui-radius: ${appConfig.theme.radius}rem; }`)

View File

@@ -2,7 +2,7 @@
import type { ContentNavigationItem } from '@nuxt/content'
import type { NavigationMenuItem } from '@nuxt/ui'
defineProps<{
const props = defineProps<{
links: NavigationMenuItem[]
}>()
@@ -10,7 +10,7 @@ const config = useRuntimeConfig().public
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
// const items = computed(() => props.links.map(({ icon, ...link }) => link))
const items = computed(() => props.links.map(({ icon, ...link }) => link))
defineShortcuts({
meta_g: () => {
@@ -29,7 +29,7 @@ defineShortcuts({
</NuxtLink>
</template>
<!-- <UNavigationMenu :items="items" variant="link" /> -->
<UNavigationMenu :items="items" variant="link" />
<template #right>
<ThemePicker />

View File

@@ -13,33 +13,26 @@ const colorMode = useColorMode()
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content'))
const { data: files } = await useAsyncData('files', () => queryCollectionSearchSections('content', { ignoredTags: ['style'] }))
const links = computed(() => {
return [{
label: 'Docs',
icon: 'i-lucide-book-open',
to: '/getting-started',
active: route.path.startsWith('/getting-started') || route.path.startsWith('/components')
}, ...(navigation.value?.find(item => item.path === '/pro')
? [{
label: 'Pro',
icon: 'i-lucide-layers-3',
to: '/pro',
active: route.path.startsWith('/pro/getting-started') || route.path.startsWith('/pro/components') || route.path.startsWith('/pro/prose')
}, {
label: 'Pricing',
icon: 'i-lucide-credit-card',
to: '/pro/pricing'
}, {
label: 'Templates',
icon: 'i-lucide-monitor',
to: '/pro/templates'
}]
: []), {
label: 'Releases',
icon: 'i-lucide-rocket',
to: '/releases'
}].filter(Boolean)
})
const links = computed(() => [{
label: 'Docs',
icon: 'i-lucide-book-open',
to: '/getting-started',
active: route.path.startsWith('/getting-started')
}, {
label: 'Components',
icon: 'i-lucide-box',
to: '/components',
active: route.path.startsWith('/components')
}, {
label: 'Roadmap',
icon: 'i-lucide-map',
to: '/roadmap'
}, {
label: 'Releases',
icon: 'i-lucide-rocket',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
}].filter(Boolean))
const color = computed(() => colorMode.value === 'dark' ? (colors as any)[appConfig.ui.colors.neutral][900] : 'white')
const radius = computed(() => `:root { --ui-radius: ${appConfig.theme.radius}rem; }`)

View File

@@ -34,7 +34,7 @@ defineOgImageComponent('Docs', {
})
const communityLinks = computed(() => [{
icon: 'i-lucide-square-pen',
icon: 'i-lucide-file-pen',
label: 'Edit this page',
to: `https://github.com/nuxt/ui/edit/v3/docs/content/${page?.value?.stem}.md`,
target: '_blank'
@@ -43,10 +43,6 @@ const communityLinks = computed(() => [{
label: 'Star on GitHub',
to: 'https://github.com/nuxt/ui',
target: '_blank'
}, {
label: 'Roadmap',
icon: 'i-lucide-map',
to: '/roadmap'
}])
// const resourcesLinks = [{

View File

@@ -1 +1,2 @@
title: Getting Started
icon: i-lucide-square-play

View File

@@ -0,0 +1,2 @@
title: Composables
icon: i-lucide-square-function

View File

@@ -0,0 +1,2 @@
title: Components
icon: i-lucide-square-code