From 717e35f0988fb73bf011f4ad4d1bc883586e1c8e Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 14 May 2025 12:39:40 +0200 Subject: [PATCH] docs(app): improve slug page metas --- docs/app/pages/[...slug].vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/app/pages/[...slug].vue b/docs/app/pages/[...slug].vue index a56108d3..8492b53e 100644 --- a/docs/app/pages/[...slug].vue +++ b/docs/app/pages/[...slug].vue @@ -65,13 +65,17 @@ if (!import.meta.prerender) { }) } -const type = page.value?.path.includes('components') ? 'Vue Component ' : page.value?.path.includes('composables') ? 'Vue Composable ' : '' +const title = page.value?.navigation?.title ? page.value.navigation.title : page.value?.title +const prefix = page.value?.path.includes('components') || page.value?.path.includes('composables') ? 'Vue ' : '' +const suffix = page.value?.path.includes('components') ? 'Component ' : page.value?.path.includes('composables') ? 'Composable ' : '' +const description = page.value?.description + useSeoMeta({ - titleTemplate: `%s ${type}- Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} ${page.value.framework === 'vue' ? ' for Vue' : ''}`, - title: page.value.navigation?.title ? page.value.navigation.title : page.value.title, - ogTitle: `${page.value.navigation?.title ? page.value.navigation.title : page.value.title} ${type}- Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} ${page.value.framework === 'vue' ? ' for Vue' : ''}`, - description: page.value.description, - ogDescription: page.value.description + titleTemplate: `${prefix}%s ${suffix}- Nuxt UI ${page.value?.module === 'ui-pro' ? 'Pro' : ''} ${page.value?.framework === 'vue' ? ' for Vue' : ''}`, + title, + ogTitle: `${prefix}${title} ${suffix}- Nuxt UI ${page.value?.module === 'ui-pro' ? 'Pro' : ''} ${page.value?.framework === 'vue' ? ' for Vue' : ''}`, + description, + ogDescription: description }) if (route.path.startsWith('/components')) {