docs(deps): update @nuxt/content

This commit is contained in:
Benjamin Canac
2024-11-29 16:01:33 +01:00
parent 0d41210c91
commit e3b8d0e60e
15 changed files with 125 additions and 44 deletions

View File

@@ -7,7 +7,7 @@ const route = useRoute()
const appConfig = useAppConfig()
const colorMode = useColorMode()
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content'))
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content', ['framework']))
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('content'), {
server: false
})

View File

@@ -3,6 +3,7 @@ import type { ContentNavigationItem } from '@nuxt/content'
import { findPageBreadcrumb, mapContentNavigation } from '#ui-pro/utils/content'
const route = useRoute()
const { framework } = useSharedData()
definePageMeta({
layout: 'docs'
@@ -13,21 +14,23 @@ if (!page.value) {
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
}
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => queryCollectionItemSurroundings('content', route.path, {
fields: ['description']
}))
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
return queryCollectionItemSurroundings('content', route.path, {
fields: ['description']
}).orWhere(group => group.where('framework', '=', framework.value).where('framework', 'IS NULL'))
}, {
watch: [framework]
})
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
const breadcrumb = computed(() => mapContentNavigation(findPageBreadcrumb(navigation?.value, page.value)).map(({ icon, ...link }) => link))
const { framework } = useSharedData()
// Redirect to the correct framework version if the page is not the current framework
if (!import.meta.prerender) {
watch(framework, () => {
if (page.value?.navigation?.framework && page.value?.navigation?.framework !== framework.value) {
if (route.path.endsWith(`/${page.value?.navigation?.framework}`)) {
if (page.value?.framework && page.value?.framework !== framework.value) {
if (route.path.endsWith(`/${page.value?.framework}`)) {
navigateTo(`${route.path.split('/').slice(0, -1).join('/')}/${framework.value}`)
} else {
navigateTo(`/getting-started`)
@@ -38,15 +41,15 @@ if (!import.meta.prerender) {
// Update the framework if the page has a different framework
watch(page, () => {
if (page.value?.navigation?.framework && page.value?.navigation?.framework !== framework.value) {
framework.value = page.value?.navigation?.framework as string
if (page.value?.framework && page.value?.framework !== framework.value) {
framework.value = page.value?.framework as string
}
}, { immediate: true })
useSeoMeta({
titleTemplate: '%s - Nuxt UI v3',
title: typeof page.value.navigation === 'object' && page.value.navigation.title ? page.value.navigation.title : page.value.title,
ogTitle: `${typeof page.value.navigation === 'object' && page.value.navigation.title ? page.value.navigation.title : page.value.title} - Nuxt UI v3`,
title: page.value.navigation?.title ? page.value.navigation.title : page.value.title,
ogTitle: `${page.value.navigation?.title ? page.value.navigation.title : page.value.title} - Nuxt UI v3`,
description: page.value.description,
ogDescription: page.value.description
})

View File

@@ -5,9 +5,9 @@ export const collections = {
type: 'page',
source: '**/*',
schema: z.object({
framework: z.string().optional(),
navigation: z.object({
title: z.string().optional(),
framework: z.string().optional()
title: z.string().optional()
}),
links: z.array(z.object({
label: z.string(),

View File

@@ -1,7 +1,7 @@
---
title: Installation
description: 'Learn how to install and configure Nuxt UI in your Nuxt application.'
navigation.framework: nuxt
framework: nuxt
---
::callout{to="/getting-started/installation/vue" icon="i-logos-vue" class="hidden"}

View File

@@ -1,7 +1,7 @@
---
title: Installation
description: 'Learn how to install and configure Nuxt UI in your Vue application.'
navigation.framework: vue
framework: vue
---
::callout{to="/getting-started/installation/nuxt" icon="i-logos-nuxt-icon" class="hidden"}

View File

@@ -1,7 +1,7 @@
---
title: Icons
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.'
navigation.framework: nuxt
framework: nuxt
links:
- label: 'Iconify'
to: https://iconify.design/

View File

@@ -1,7 +1,7 @@
---
title: Icons
description: 'Nuxt UI integrates with Iconify to access over 200,000+ icons.'
navigation.framework: vue
framework: vue
links:
- label: 'Iconify'
to: https://iconify.design/

View File

@@ -1,7 +1,7 @@
---
title: Fonts
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.'
navigation.framework: nuxt
framework: nuxt
links:
- label: 'nuxt/fonts'
to: https://github.com/nuxt/fonts

View File

@@ -1,7 +1,7 @@
---
title: Color Mode
description: 'Nuxt UI integrates with Nuxt Color Mode to allow for easy switching between light and dark themes.'
navigation.framework: nuxt
framework: nuxt
links:
- label: 'nuxtjs/color-mode'
to: https://github.com/nuxt-modules/color-mode

View File

@@ -1,7 +1,7 @@
---
title: Color Mode
description: 'Nuxt UI integrates with VueUse to allow for easy switching between light and dark themes.'
navigation.framework: vue
framework: vue
---
::callout{to="/getting-started/color-mode/nuxt" icon="i-logos-nuxt-icon" class="hidden"}

View File

@@ -1,7 +1,7 @@
---
title: Internationalization (i18n)
description: 'Learn how to internationalize your Nuxt app with multi-directional support (LTR/RTL).'
navigation.framework: nuxt
framework: nuxt
---
::callout{to="/getting-started/i18n/vue" icon="i-logos-vue" class="hidden"}

View File

@@ -1,7 +1,7 @@
---
title: Internationalization (i18n)
description: 'Learn how to internationalize your Vue app with multi-directional support (LTR/RTL).'
navigation.framework: vue
framework: vue
---
::callout{to="/getting-started/i18n/nuxt" icon="i-logos-nuxt-icon" class="hidden"}

View File

@@ -41,15 +41,6 @@ export default defineNuxtConfig({
markdown: {
highlight: {
langs: ['bash', 'ts', 'typescript', 'diff', 'vue', 'json', 'yml', 'css', 'mdc']
},
remarkPlugins: {
'remark-mdc': {
options: {
experimental: {
autoUnwrap: false
}
}
}
}
}
}

View File

@@ -7,7 +7,7 @@
"@iconify-json/lucide": "^1.2.16",
"@iconify-json/simple-icons": "^1.2.13",
"@iconify-json/vscode-icons": "^1.2.2",
"@nuxt/content": "3.0.0-alpha.7",
"@nuxt/content": "https://pkg.pr.new/@nuxt/content@7f8f128",
"@nuxt/image": "^1.8.1",
"@nuxt/ui": "latest",
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@1408077",

109
pnpm-lock.yaml generated
View File

@@ -250,8 +250,8 @@ importers:
specifier: ^1.2.2
version: 1.2.2
'@nuxt/content':
specifier: 3.0.0-alpha.7
version: 3.0.0-alpha.7(@libsql/client@0.14.0)(magicast@0.3.5)(pg@8.13.1)(rollup@4.27.3)
specifier: https://pkg.pr.new/@nuxt/content@7f8f128
version: https://pkg.pr.new/@nuxt/content@7f8f128(@libsql/client@0.14.0)(magicast@0.3.5)(pg@8.13.1)(rollup@4.27.3)
'@nuxt/image':
specifier: ^1.8.1
version: 1.8.1(ioredis@5.4.1)(magicast@0.3.5)(rollup@4.27.3)
@@ -1413,8 +1413,9 @@ packages:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
'@nuxt/content@3.0.0-alpha.7':
resolution: {integrity: sha512-weDrE+Q9R05oPHb37LbV+BRnk/7KPI1glpqvhrrBhOWDloM4PkSFKlZcvD8HA3OCN8AjYLqmd6fX/c/nh0LEyA==}
'@nuxt/content@https://pkg.pr.new/@nuxt/content@7f8f128':
resolution: {tarball: https://pkg.pr.new/@nuxt/content@7f8f128}
version: 3.0.0-alpha.7
peerDependencies:
'@libsql/client': '*'
pg: '*'
@@ -1544,8 +1545,8 @@ packages:
'@nuxtjs/color-mode@3.5.2':
resolution: {integrity: sha512-cC6RfgZh3guHBMLLjrBB2Uti5eUoGM9KyauOaYS9ETmxNWBMTvpgjvSiSJp1OFljIXPIqVTJ3xtJpSNZiO3ZaA==}
'@nuxtjs/mdc@0.9.5':
resolution: {integrity: sha512-bTnlY+oiW8QsmrLoiYN+rkSYxl7asELlwYeU9QPSkun5BVx7Yd8RajH8I+0QJZiMZzIHaO3LEgf3lzp5Lg6E0A==}
'@nuxtjs/mdc-edge@0.9.6-28878468.06517f9':
resolution: {integrity: sha512-Ua667m/8oUA3iBlEWIykVEryFyfUwmvu2VL2GhmUrALHSyfKkMiRoOFyh49bLZYV9v3y+POA9Fm7Gyqi21uY/A==}
'@nuxtjs/plausible@1.1.1':
resolution: {integrity: sha512-vjpMg84+oQ5zte+XeDMMwXIa4lIkS19i8CfOBNjqoX9zZWmWNsL6zIzPn4zdg9puzapKQYw1IBCki1E0PG11mA==}
@@ -2089,6 +2090,9 @@ packages:
resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}
engines: {node: '>=18'}
'@socket.io/component-emitter@3.1.2':
resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==}
'@sqlite.org/sqlite-wasm@3.47.0-build1':
resolution: {integrity: sha512-n2lLez+PwcN+WQdgRIm6OCaGvQUHOx+kEmlL7pq0G4xuK+NaKxnbF4wI6XhfZ4HbyG2sla1Qt4ImaD6hpwoMtg==}
hasBin: true
@@ -3568,6 +3572,13 @@ packages:
end-of-stream@1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
engine.io-client@6.6.2:
resolution: {integrity: sha512-TAr+NKeoVTjEVW8P3iHguO1LO6RlUz9O5Y8o7EY0fU+gY1NYqas7NN3slpFtbXEsLMHk0h90fJMfKjRkQ0qUIw==}
engine.io-parser@5.2.3:
resolution: {integrity: sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==}
engines: {node: '>=10.0.0'}
enhanced-resolve@5.17.1:
resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==}
engines: {node: '>=10.13.0'}
@@ -4950,6 +4961,10 @@ packages:
engines: {node: '>=16.13'}
hasBin: true
minimatch@10.0.1:
resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==}
engines: {node: 20 || >=22}
minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
@@ -6145,6 +6160,14 @@ packages:
smob@1.5.0:
resolution: {integrity: sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==}
socket.io-client@4.8.1:
resolution: {integrity: sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==}
engines: {node: '>=10.0.0'}
socket.io-parser@4.2.4:
resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==}
engines: {node: '>=10.0.0'}
socks-proxy-agent@8.0.4:
resolution: {integrity: sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==}
engines: {node: '>= 14'}
@@ -7092,6 +7115,18 @@ packages:
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
ws@8.17.1:
resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
ws@8.18.0:
resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==}
engines: {node: '>=10.0.0'}
@@ -7112,6 +7147,10 @@ packages:
resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
engines: {node: '>=12'}
xmlhttprequest-ssl@2.1.2:
resolution: {integrity: sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==}
engines: {node: '>=0.4.0'}
xss@1.0.15:
resolution: {integrity: sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==}
engines: {node: '>= 0.10.0'}
@@ -8053,11 +8092,11 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.17.1
'@nuxt/content@3.0.0-alpha.7(@libsql/client@0.14.0)(magicast@0.3.5)(pg@8.13.1)(rollup@4.27.3)':
'@nuxt/content@https://pkg.pr.new/@nuxt/content@7f8f128(@libsql/client@0.14.0)(magicast@0.3.5)(pg@8.13.1)(rollup@4.27.3)':
dependencies:
'@libsql/client': 0.14.0
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3)
'@nuxtjs/mdc': 0.9.5(magicast@0.3.5)(rollup@4.27.3)
'@nuxtjs/mdc': '@nuxtjs/mdc-edge@0.9.6-28878468.06517f9(magicast@0.3.5)(rollup@4.27.3)'
'@sqlite.org/sqlite-wasm': 3.47.0-build1
better-sqlite3: 11.5.0
c12: 2.0.1(magicast@0.3.5)
@@ -8066,6 +8105,7 @@ snapshots:
defu: 6.1.4
destr: 2.0.3
fast-glob: 3.3.2
git-url-parse: 15.0.0
jiti: 2.4.0
knitwork: 1.1.0
listhen: 1.9.0
@@ -8077,13 +8117,18 @@ snapshots:
micromark-util-resolve-all: 2.0.1
micromark-util-sanitize-uri: 2.0.1
micromatch: 4.0.8
minimatch: 10.0.1
nuxt-component-meta: 0.9.0(magicast@0.3.5)(rollup@4.27.3)
ohash: 1.1.4
parse-git-config: 3.0.0
pathe: 1.1.2
pg: 8.13.1
pkg-types: 1.2.1
remark-mdc: 3.4.0
scule: 1.3.0
shiki: 1.23.1
slugify: 1.6.6
socket.io-client: 4.8.1
tar: 7.4.3
typescript: 5.6.3
ufo: 1.5.4
@@ -8686,7 +8731,7 @@ snapshots:
- rollup
- supports-color
'@nuxtjs/mdc@0.9.5(magicast@0.3.5)(rollup@4.27.3)':
'@nuxtjs/mdc-edge@0.9.6-28878468.06517f9(magicast@0.3.5)(rollup@4.27.3)':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3)
'@shikijs/transformers': 1.23.1
@@ -9226,6 +9271,8 @@ snapshots:
'@sindresorhus/merge-streams@4.0.0': {}
'@socket.io/component-emitter@3.1.2': {}
'@sqlite.org/sqlite-wasm@3.47.0-build1': {}
'@standard-schema/spec@1.0.0-beta.3': {}
@@ -10861,6 +10908,20 @@ snapshots:
dependencies:
once: 1.4.0
engine.io-client@6.6.2:
dependencies:
'@socket.io/component-emitter': 3.1.2
debug: 4.3.7(supports-color@9.4.0)
engine.io-parser: 5.2.3
ws: 8.17.1
xmlhttprequest-ssl: 2.1.2
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
engine.io-parser@5.2.3: {}
enhanced-resolve@5.17.1:
dependencies:
graceful-fs: 4.2.11
@@ -12676,6 +12737,10 @@ snapshots:
- supports-color
- utf-8-validate
minimatch@10.0.1:
dependencies:
brace-expansion: 2.0.1
minimatch@3.1.2:
dependencies:
brace-expansion: 1.1.11
@@ -13154,7 +13219,7 @@ snapshots:
'@vue/shared': 3.5.13
acorn: 8.14.0
c12: 2.0.1(magicast@0.3.5)
chokidar: 3.6.0
chokidar: 4.0.1
compatx: 0.1.8
consola: 3.2.3
cookie-es: 1.2.2
@@ -13267,7 +13332,7 @@ snapshots:
'@vue/shared': 3.5.13
acorn: 8.14.0
c12: 2.0.1(magicast@0.3.5)
chokidar: 3.6.0
chokidar: 4.0.1
compatx: 0.1.8
consola: 3.2.3
cookie-es: 1.2.2
@@ -14503,6 +14568,24 @@ snapshots:
smob@1.5.0: {}
socket.io-client@4.8.1:
dependencies:
'@socket.io/component-emitter': 3.1.2
debug: 4.3.7(supports-color@9.4.0)
engine.io-client: 6.6.2
socket.io-parser: 4.2.4
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
socket.io-parser@4.2.4:
dependencies:
'@socket.io/component-emitter': 3.1.2
debug: 4.3.7(supports-color@9.4.0)
transitivePeerDependencies:
- supports-color
socks-proxy-agent@8.0.4:
dependencies:
agent-base: 7.1.1(supports-color@9.4.0)
@@ -15601,12 +15684,16 @@ snapshots:
wrappy@1.0.2: {}
ws@8.17.1: {}
ws@8.18.0: {}
xdg-basedir@5.1.0: {}
xml-name-validator@4.0.0: {}
xmlhttprequest-ssl@2.1.2: {}
xss@1.0.15:
dependencies:
commander: 2.20.3