Skip to content

Commit

Permalink
Add OpenGraph tag for Fediverse creator 🏷️.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Sep 16, 2024
1 parent c273156 commit 69afb75
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/BaseHead.astro
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
---
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 69afb75

Please sign in to comment.