-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
42 lines (39 loc) · 1.22 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script setup lang="ts">
const { t } = useI18n()
const route = useRoute()
const head = useLocaleHead({
addDirAttribute: true,
identifierAttribute: 'id',
addSeoAttributes: true
})
const title = computed(() => `${route.meta.title ? t(route.meta.title as string) : ''}`)
const description = computed(() => t(route.meta.description as string ?? 'description'))
useHead({
title,
titleTemplate: (titleChunk) => {
return titleChunk ? `${titleChunk} - GopherDay Taiwan 2024` : 'GopherDay Taiwan 2024'
},
meta: [
{ property: 'description', content: description },
{ property: 'og:title', content: title },
{ property: 'og:description', content: description }
]
})
</script>
<template>
<Html :lang="head.htmlAttrs?.lang" :dir="head.htmlAttrs?.dir">
<Head>
<template v-for="link in head.link" :key="link.id">
<Link :id="link.id" :rel="link.rel" :href="link.href" :hreflang="link.hreflang" />
</template>
<template v-for="meta in head.meta" :key="meta.id">
<Meta :id="meta.id" :property="meta.property" :content="meta.content" />
</template>
</Head>
<Body class="font-sans">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</Body>
</Html>
</template>