Files
yphsalumni.org/app/pages/news/[slug].vue
xiaomai b05faddfc0 feat(seo): implement dynamic page titles
This commit enhances SEO and user experience by setting dynamic page titles for detail pages and updating the global title configuration.

- Event, Hall of Fame, and News detail pages now use the specific item's title as the page title.
- The global `titleTemplate` and default `title` in `nuxt.config.ts` have been updated for better branding.
- These changes ensure each page has a unique, descriptive title, which is beneficial for search engine ranking and browser tab clarity.
2025-10-04 11:03:21 +08:00

33 lines
780 B
Vue

<template>
<div>
<section class="py-20 px-4">
<div class="container mx-auto max-w-6xl">
<!-- 内容渲染器 -->
<div class="prose prose-invert prose-lg max-w-none">
<ContentRenderer :value="n ?? {}">
<template #empty>
<div class="text-center py-12">
<p class="text-gray-400 text-xl">内容加载中...</p>
</div>
</template>
</ContentRenderer>
</div>
</div>
</section>
</div>
</template>
<script lang="ts" setup>
const route = useRoute()
const { data: n } = await useAsyncData('new-detail', () =>
queryCollection('news')
.path(`/news/${route.params.slug}`)
.first()
)
useHead({
title: n.value?.title
})
</script>
<style></style>