feat: Add more SEO metadata to all pages

This commit is contained in:
Jesse Wierzbinski 2024-12-07 11:21:13 +01:00
parent 5a6a7d4fdd
commit a19339bd33
No known key found for this signature in database
14 changed files with 58 additions and 5 deletions

View file

@ -11,6 +11,7 @@
</template>
<script setup lang="ts">
import { useTitle } from "@vueuse/core";
import { Loader } from "lucide-vue-next";
import Note from "~/components/notes/note.vue";
@ -54,10 +55,14 @@ watch(
},
);
useServerSeoMeta({
title: note.value?.account.display_name,
description: note.value?.content,
ogImage: note.value?.media_attachments[0]?.preview_url,
useSeoMeta({
title: computed(() =>
note.value ? note.value.account.display_name : "Loading",
),
description: computed(() => (note.value ? note.value.content : undefined)),
ogImage: computed(() =>
note.value ? note.value.media_attachments[0]?.preview_url : undefined,
),
robots: computed(() => ({
noindex: !!note.value?.account.noindex,
nofollow: !!note.value?.account.noindex,

View file

@ -41,7 +41,7 @@ definePageMeta({
const { account, isLoading } = useAccountFromAcct(client, username);
const accountId = computed(() => account.value?.id ?? undefined);
useServerSeoMeta({
useSeoMeta({
title: computed(() =>
account.value ? account.value.display_name : "Loading",
),