diff --git a/quartz/plugins/emitters/ogImage.tsx b/quartz/plugins/emitters/ogImage.tsx index 64f167a4a..030208d84 100644 --- a/quartz/plugins/emitters/ogImage.tsx +++ b/quartz/plugins/emitters/ogImage.tsx @@ -4,7 +4,8 @@ import { unescapeHTML } from "../../util/escape" import { FullSlug, getFileExtension, - isAbsoluteFilePath, + isFullUrl, + isRelativeURL, joinSegments, QUARTZ, } from "../../util/path" @@ -153,9 +154,9 @@ export const CustomOgImages: QuartzEmitterPlugin> = let userDefinedOgImagePath = pageData.frontmatter?.socialImage if (userDefinedOgImagePath) { - userDefinedOgImagePath = isAbsoluteFilePath(userDefinedOgImagePath) - ? userDefinedOgImagePath - : `https://${baseUrl}/static/${socialImage}` + userDefinedOgImagePath = isRelativeURL(userDefinedOgImagePath) + ? `https://${baseUrl}/static/${userDefinedOgImagePath}` + : userDefinedOgImagePath } const generatedOgImagePath = isRealFile