-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathapp.vue
61 lines (61 loc) · 1.74 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<template>
<NuxtPage />
</template>
<script setup lang="ts">
const { t } = useI18n()
const route = useRoute()
const i18nHead = useLocaleHead({
addSeoAttributes: true
})
const url = useRequestURL()
// const origin = 'https://' + url.host
const origin = url.origin
useHead({
htmlAttrs: {
lang: i18nHead.value.htmlAttrs?.lang
},
titleTemplate: titleChunk => {
return (route.name as string).startsWith('index') && !route.query.q ? titleChunk || t('seo.title') : `${titleChunk} - SearchEmoji`
},
link: [
...(i18nHead.value.link || []),
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon-16x16.png'
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon-32x32.png'
},
{
rel: 'apple-touch-icon',
sizes: '152x152',
href: '/apple-touch-icon.png'
},
{
rel: 'manifest',
href: '/site.webmanifest'
}
],
meta: [
...(i18nHead.value?.meta || []),
{ name: 'description', content: t('seo.description') },
{ property: 'og:site_name', content: t('seo.siteName') },
{ property: 'og:url', content: `${origin}/` },
{ property: 'og:type', content: 'website' },
{ property: 'og:title', content: t('seo.title') },
{ property: 'og:description', content: t('seo.description') },
{ property: 'og:image', content: `${origin}/cover.jpg` },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:domain', content: url.host },
{ name: 'twitter:url', content: `${origin}/` },
{ name: 'twitter:title', content: t('seo.title') },
{ name: 'twitter:description', content: t('seo.description') },
{ name: 'twitter:image', content: `${origin}/cover.jpg` }
]
})
</script>