From c01c9c82dd867ab229ba9071fa8aff3d1559959f Mon Sep 17 00:00:00 2001 From: Nikolai Dorofeev Date: Fri, 6 Sep 2024 10:13:17 +0400 Subject: [PATCH] chore: Update SEO metadata in app and blog components --- apps/d0rich.me/app.vue | 3 +- .../components/AsyncSafeSeoWithOg.vue | 31 ++++++++++++++----- apps/d0rich.me/pages/blog/[...slug].vue | 25 +++++++++++++-- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/apps/d0rich.me/app.vue b/apps/d0rich.me/app.vue index ca8b010b..130bee55 100644 --- a/apps/d0rich.me/app.vue +++ b/apps/d0rich.me/app.vue @@ -44,8 +44,7 @@ useSeoMeta({ ogDescription: description, author: 'Nikolai Dorofeev', generator: 'Nuxt 3', - // colorScheme: 'dark', - ogSiteName: 'd0rich', + ogSiteName: 'd0rich.me', ogImage: 'https://d0rich.me/og/image.jpg', ogUrl: computed(() => 'https://d0rich.me' + route.path), twitterCard: 'summary_large_image', diff --git a/apps/d0rich.me/components/AsyncSafeSeoWithOg.vue b/apps/d0rich.me/components/AsyncSafeSeoWithOg.vue index 1f7aec36..27a8c409 100644 --- a/apps/d0rich.me/components/AsyncSafeSeoWithOg.vue +++ b/apps/d0rich.me/components/AsyncSafeSeoWithOg.vue @@ -1,10 +1,17 @@ diff --git a/apps/d0rich.me/pages/blog/[...slug].vue b/apps/d0rich.me/pages/blog/[...slug].vue index c2ff96ac..7e9b876a 100644 --- a/apps/d0rich.me/pages/blog/[...slug].vue +++ b/apps/d0rich.me/pages/blog/[...slug].vue @@ -3,7 +3,8 @@ import { Disqus } from 'vue-disqus' import type { MarkdownParsedContent } from '@nuxt/content/dist/runtime/types' interface Document extends MarkdownParsedContent { - date?: Date + date?: string + image?: string } const slug = clearSlug(useRoute().params.slug as string[]) @@ -53,16 +54,34 @@ const linkToBlog = computed(() => { Math.floor((position.value ?? 1) / (itemsOnPage - 1) + 1) ) }) + +const docDate = computed(() => { + if (!doc.value?.date) return undefined + return new Date(doc.value.date) +})