fix: 🐛 need new fallback for ogImage #25

Merged
create-issue-branch[bot] merged 2 commits from issue-24-need_new_fallback_for_ogImage into main 2024-03-16 18:05:57 +00:00
4 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@matthiesenxyz/astro-hashnode": patch
---
[fix] add extra fallback option for ogImage

View File

@ -129,6 +129,9 @@ export const getPublication = async () => {
displayTitle
descriptionSEO
favicon
author {
profilePicture
}
preferences {
logo
disableFooterBranding

View File

@ -60,6 +60,9 @@ export const PublicationDataSchema = z.object({
displayTitle: z.string(),
descriptionSEO: z.string(),
favicon: z.string(),
author: z.object({
profilePicture: z.string(),
}),
preferences: z.object({
logo: z.string(),
disableFooterBranding: z.boolean(),

View File

@ -41,7 +41,7 @@ const { pageTitle, hideFooter, hideHeader, ogImage } = Astro.props as AstroHashn
basic: {
title: pageTitle ? pageTitle + " | " + pubHeader : pubHeader,
type: 'text',
image: ogImage || pubData.favicon,
image: ogImage || pubData.favicon || pubData.author.profilePicture,
},
optional: {
description: pubData.descriptionSEO,