From b1324c53ee8d2a3de0878d8553cf52e71db7799f Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Thu, 9 Jan 2025 21:13:35 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20am=C3=A9lioration=20des=20images=20meta?= =?UTF-8?q?=20og?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Meta.astro | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: "",