From e940d966e49fa91d729e045bd2f67b9346d42aa6 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Thu, 9 Jan 2025 19:22:45 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20am=C3=A9lioration=20des=20meta=20og?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Meta.astro | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/Meta.astro b/src/components/Meta.astro index 5baaa76..c57dc98 100644 --- a/src/components/Meta.astro +++ b/src/components/Meta.astro @@ -11,6 +11,8 @@ const defaultProps = { structuredData: SEO.structuredData, }; +const sd = SEO.structuredData; + // Extract props with default values assigned from defaultProps. Values can be overridden when the component is used. // For example: // @@ -31,7 +33,7 @@ const socialImageRes = await getImage({ width: 1200, height: 600, }); -const socialImage = structuredData.image || Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694) +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 languages: { [key: string]: string } = { en: "", @@ -48,17 +50,6 @@ function createHref(lang: string, prefix: string, path: string): string { const fullPath: string = Astro.url.pathname; -const alternateLanguageLinks: string = Object.entries(languages) - .map(([lang, prefix]: [string, string]) => { - const basePath: string = - lang === "en" ? fullPath.replace(/^\/fr\//, "/") : fullPath; - - const href: string = createHref(lang, prefix, basePath); - - return ``; - }) - .join("\n"); - const appleTouchIcon = await getImage({ src: faviconSrc, @@ -87,7 +78,6 @@ const appleTouchIcon = await getImage({ /> -