docs: consistent canonical and markdown alternate across pages

This commit is contained in:
Benjamin Canac
2026-09-09 13:57:14 +02:00
parent 6b0945c6fd
commit cd04e7b64a
3 changed files with 15 additions and 17 deletions
+2 -2
View File
@@ -75,6 +75,8 @@ useSeoMeta({
const path = computed(() => route.path.replace(/\/$/, ''))
useCanonical(computed(() => `/raw${path.value}.md`))
if (import.meta.server) {
if (route.path.startsWith('/docs/components/')) {
defineOgImage('Component.takumi', {
@@ -106,8 +108,6 @@ if (import.meta.server) {
])
}
useCanonical(computed(() => `${path.value}.md`))
const { open, ask } = useChat()
const studioIcons = useStudioIcons()
+11 -13
View File
@@ -44,9 +44,18 @@ const pills = computed(() => presets.map(preset => ({
apply: () => applyPreset(preset)
})))
if (import.meta.server) {
prerenderRoutes(['/raw/index.md'])
useSeoMeta({
titleTemplate: '%s - Nuxt UI',
title: page.value.title,
description: page.value.description,
ogTitle: `${page.value.title} - Nuxt UI`,
ogDescription: page.value.description,
ogImage: joinURL(url, '/og-image.png')
})
useCanonical('/raw/index.md')
if (import.meta.server) {
useSchemaOrg([
defineSoftwareApp({
name: 'Nuxt UI',
@@ -56,17 +65,6 @@ if (import.meta.server) {
})
])
}
useCanonical('/raw/index.md')
useSeoMeta({
titleTemplate: '%s - Nuxt UI',
title: page.value.title,
description: page.value.description,
ogTitle: `${page.value.title} - Nuxt UI`,
ogDescription: page.value.description,
ogImage: joinURL(url, '/og-image.png')
})
</script>
<template>
+2 -2
View File
@@ -433,8 +433,8 @@ export default defineNuxtConfig({
domain: 'https://ui.nuxt.com',
title: 'Nuxt UI',
description: 'A comprehensive Vue UI component library (Nuxt optional) with 125+ accessible, production-ready, Tailwind CSS components for building modern web applications.',
// Disable content module's built-in raw markdown route - we use our own custom handler
// in server/routes/raw/[...slug].md.get.ts that applies MDC transformations
// Disable content module's built-in raw markdown route, `/raw/**` is served
// by nuxt-agent-discovery through the adapter in server/plugins/agent-discovery.ts
contentRawMarkdown: false,
full: {
title: 'Nuxt UI Full Documentation',