mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
fix(ogImage): update socialImage path to include base URL if defined
This commit is contained in:
parent
fbca56f278
commit
248ad2c4ed
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user