Add fallback option for ogImage and include author profile picture
This commit is contained in:
parent
7f5508d529
commit
d8c0ad0bae
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@matthiesenxyz/astro-hashnode": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
[fix] add extra fallback option for ogImage
|
|
@ -129,6 +129,9 @@ export const getPublication = async () => {
|
||||||
displayTitle
|
displayTitle
|
||||||
descriptionSEO
|
descriptionSEO
|
||||||
favicon
|
favicon
|
||||||
|
author {
|
||||||
|
profilePicture
|
||||||
|
}
|
||||||
preferences {
|
preferences {
|
||||||
logo
|
logo
|
||||||
disableFooterBranding
|
disableFooterBranding
|
||||||
|
|
|
@ -60,6 +60,9 @@ export const PublicationDataSchema = z.object({
|
||||||
displayTitle: z.string(),
|
displayTitle: z.string(),
|
||||||
descriptionSEO: z.string(),
|
descriptionSEO: z.string(),
|
||||||
favicon: z.string(),
|
favicon: z.string(),
|
||||||
|
author: z.object({
|
||||||
|
profilePicture: z.string(),
|
||||||
|
}),
|
||||||
preferences: z.object({
|
preferences: z.object({
|
||||||
logo: z.string(),
|
logo: z.string(),
|
||||||
disableFooterBranding: z.boolean(),
|
disableFooterBranding: z.boolean(),
|
||||||
|
|
|
@ -41,7 +41,7 @@ const { pageTitle, hideFooter, hideHeader, ogImage } = Astro.props as AstroHashn
|
||||||
basic: {
|
basic: {
|
||||||
title: pageTitle ? pageTitle + " | " + pubHeader : pubHeader,
|
title: pageTitle ? pageTitle + " | " + pubHeader : pubHeader,
|
||||||
type: 'text',
|
type: 'text',
|
||||||
image: ogImage || pubData.favicon,
|
image: ogImage || pubData.favicon || pubData.author.profilePicture,
|
||||||
},
|
},
|
||||||
optional: {
|
optional: {
|
||||||
description: pubData.descriptionSEO,
|
description: pubData.descriptionSEO,
|
||||||
|
|
Loading…
Reference in New Issue