diff --git a/src/components/Meta.astro b/src/components/Meta.astro index c57dc98..ca9c226 100644 --- a/src/components/Meta.astro +++ b/src/components/Meta.astro @@ -33,7 +33,9 @@ const socialImageRes = await getImage({ width: 1200, height: 600, }); -const socialImage = (Astro.url.origin + structuredData.image?.src.toString()) || Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694) +const socialImage = structuredData?.image?.src + ? (Astro.url.origin + structuredData.image.src) + : Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694) const languages: { [key: string]: string } = { en: "",