Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: don't add pro path if it doesn't exist #917

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const navigation = computed(() => {
const pro = nav.value.find(item => item._path === '/pro')

return [
pro,
...(pro ? [pro] : []),
...dev
]
}
Expand Down Expand Up @@ -78,7 +78,7 @@ const links = computed(() => {
label: 'Roadmap',
icon: 'i-heroicons-academic-cap',
to: '/roadmap'
}, {
}, !!navigation.value.find(item => item._path === '/pro') && {
label: 'Pro',
icon: 'i-heroicons-square-3-stack-3d',
to: '/pro',
Expand Down Expand Up @@ -110,7 +110,7 @@ const links = computed(() => {
icon: 'i-heroicons-rocket-launch',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
}]
}].filter(Boolean)
})

// Watch
Expand Down
17 changes: 12 additions & 5 deletions docs/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', { defa
// Computed

const navigation = computed(() => {
const main = nav.value.filter(item => item._path !== '/dev')
const dev = nav.value.find(item => item._path === '/dev')?.children
if (branch.value?.name === 'dev') {
const dev = nav.value.find(item => item._path === '/dev')?.children
const pro = nav.value.find(item => item._path === '/pro')

return branch.value?.name === 'dev' ? dev : main
return [
...(pro ? [pro] : []),
...dev
]
}

return nav.value.filter(item => item._path !== '/dev')
})

const links = computed(() => {
Expand All @@ -58,7 +65,7 @@ const links = computed(() => {
label: 'Roadmap',
icon: 'i-heroicons-academic-cap',
to: '/roadmap'
}, {
}, !!navigation.value.find(item => item._path === '/pro') && {
label: 'Pro',
icon: 'i-heroicons-square-3-stack-3d',
to: '/pro',
Expand Down Expand Up @@ -90,7 +97,7 @@ const links = computed(() => {
icon: 'i-heroicons-rocket-launch',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
}]
}].filter(Boolean)
})

// Provide
Expand Down