fix(ogImage): update socialImage path to include base URL if defined

This commit is contained in:
Karim H 2025-03-19 05:16:06 -04:00
parent fbca56f278
commit 248ad2c4ed

View File

@ -145,6 +145,8 @@ export const CustomOgImages: QuartzEmitterPlugin<Partial<SocialImageOptions>> =
(pageData) => { (pageData) => {
const isRealFile = pageData.filePath !== undefined const isRealFile = pageData.filePath !== undefined
const userDefinedOgImagePath = pageData.frontmatter?.socialImage const userDefinedOgImagePath = pageData.frontmatter?.socialImage
? `https://${baseUrl}/static/${pageData.frontmatter?.socialImage}`
: undefined
const generatedOgImagePath = isRealFile const generatedOgImagePath = isRealFile
? `https://${baseUrl}/${pageData.slug!}-og-image.webp` ? `https://${baseUrl}/${pageData.slug!}-og-image.webp`
: undefined : undefined