feat: move static seo tags to nuxt config
This commit is contained in:
79
app/app.vue
79
app/app.vue
@@ -1,89 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
const TITLE = "Pihkaal";
|
||||
const DESCRIPTION =
|
||||
"23yo developer from Brittany. I love programming and taking photos.";
|
||||
const URL = "https://pihkaal.me";
|
||||
const IMAGE = `${URL}/thumbnail.png`;
|
||||
|
||||
const { locale, locales } = useI18n();
|
||||
const { locale } = useI18n();
|
||||
|
||||
const app = useAppStore();
|
||||
const pageTitle = computed(() => {
|
||||
if (!app.booted) return TITLE;
|
||||
if (!app.booted) return "Pihkaal";
|
||||
const name = app.screen.charAt(0).toUpperCase() + app.screen.slice(1);
|
||||
return `${name} - Pihkaal`;
|
||||
});
|
||||
|
||||
const ogLocale = computed(
|
||||
() => locales.value.find((l) => l.code === locale.value)?.language ?? "en-US",
|
||||
);
|
||||
const ogLocaleAlternate = computed(() =>
|
||||
locales.value.filter((l) => l.code !== locale.value).map((l) => l.language!),
|
||||
);
|
||||
|
||||
useSeoMeta({
|
||||
title: pageTitle,
|
||||
description: DESCRIPTION,
|
||||
author: "pihkaal",
|
||||
robots: "index, follow",
|
||||
|
||||
ogType: "website",
|
||||
ogTitle: TITLE,
|
||||
ogDescription: DESCRIPTION,
|
||||
ogImage: IMAGE,
|
||||
ogImageType: "image/png",
|
||||
ogImageWidth: 1200,
|
||||
ogImageHeight: 630,
|
||||
ogUrl: URL,
|
||||
ogSiteName: TITLE,
|
||||
ogLocale,
|
||||
ogLocaleAlternate,
|
||||
|
||||
themeColor: "#181818",
|
||||
|
||||
twitterCard: "summary_large_image",
|
||||
twitterTitle: TITLE,
|
||||
twitterDescription: DESCRIPTION,
|
||||
twitterImage: IMAGE,
|
||||
});
|
||||
|
||||
useHead({
|
||||
title: pageTitle,
|
||||
htmlAttrs: { lang: locale },
|
||||
link: [{ rel: "canonical", href: URL }],
|
||||
script: [
|
||||
{
|
||||
type: "application/ld+json",
|
||||
innerHTML: JSON.stringify({
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Person",
|
||||
name: "pihkaal",
|
||||
url: URL,
|
||||
email: "hello@pihkaal.me",
|
||||
jobTitle: "Full-Stack Developer",
|
||||
description: DESCRIPTION,
|
||||
image: IMAGE,
|
||||
sameAs: [
|
||||
"https://git.pihkaal.me",
|
||||
"https://linkedin.com/in/stevancorre/",
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
type: "application/ld+json",
|
||||
innerHTML: JSON.stringify({
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
name: TITLE,
|
||||
url: URL,
|
||||
description: DESCRIPTION,
|
||||
author: {
|
||||
"@type": "Person",
|
||||
name: "pihkaal",
|
||||
url: URL,
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user