generated from antfu/vitesse-nuxt
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.vue
45 lines (38 loc) · 1.07 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
<script setup lang="ts">
import type { LocaleCode } from '@/types';
import { ogLocales } from '#imports';
useHead({
titleTemplate: (titleChunk) => {
return titleChunk ? `${titleChunk} | Voe` : 'Voe · Fly Better';
},
});
const { finalizePendingLocaleChange } = useI18n();
const onBeforeEnter = async () => {
await finalizePendingLocaleChange();
};
const { locale } = useI18n();
// remove the current locale from the `ogLocales` obj,
// `Object.values` convert to [...], filter out `undefined`
const ogLocaleAlternate = Object.values({
...ogLocales,
[locale.value]: undefined,
}).filter((l) => !!l);
const ogUrl = 'https://voey.netlify.app';
const ogLocale = ogLocales[locale.value as LocaleCode] || ogLocales.en;
const ogImage = `${ogUrl}/img/og-${locale.value}.png`;
useSeoMeta({
ogUrl,
ogImage,
ogLocale,
ogLocaleAlternate,
ogSiteName: 'Voe',
ogType: 'website',
twitterSite: '@ijk_ml',
});
</script>
<template>
<NuxtLoadingIndicator />
<NuxtLayout>
<NuxtPage :transition="{ name: 'page', mode: 'out-in', onBeforeEnter }" />
</NuxtLayout>
</template>