From 69afb7519850c81e651eab83f2a0cc0a3bd94fdd Mon Sep 17 00:00:00 2001 From: edo999 Date: Mon, 16 Sep 2024 10:30:31 +0100 Subject: [PATCH] =?UTF-8?q?Add=20OpenGraph=20tag=20for=20Fediverse=20creat?= =?UTF-8?q?or=20=F0=9F=8F=B7=EF=B8=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BaseHead.astro | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 5fc2e79..0c93f0f 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -1,5 +1,5 @@ --- -import { type CollectionEntry } from 'astro:content' +import { type CollectionEntry, getEntry } from 'astro:content' import { SEO } from 'astro-seo' import Analytics from './Analytics.astro' import ViewTransitionsLogic from './ViewTransitionsLogic.astro' @@ -33,8 +33,9 @@ const { titleTemplate, } = Astro.props -// The default author is the site creator -// const creator = await getEntry("authors", "default"); +// The default author is the site creator. +const author = await getEntry('authors', 'default') +const fediverse = author.data.mastodon || author.data.pixelfed const isProduction = import.meta.env.PROD --- @@ -50,6 +51,7 @@ const isProduction = import.meta.env.PROD charset="utf-8" extend={{ meta: [ + { name: 'viewport', content: 'width=device-width,initial-scale=1' }, { name: 'theme-color', content: '#fff7ed', // bg-primary-50 @@ -60,7 +62,7 @@ const isProduction = import.meta.env.PROD content: '#020617', // bg-gray-950 media: '(prefers-color-scheme:dark)', }, - { name: 'viewport', content: 'width=device-width,initial-scale=1' }, + { name: 'fediverse:creator', content: fediverse }, ], link: [ // See https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs