From 138eaca4d6b1c3ef965ba471b8556bf283efaffd Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Fri, 2 May 2025 08:11:54 +0200 Subject: [PATCH] feat: deliver OG images as jpeg --- src/layouts/BaseLayout.astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index b54a8c1..bc4c7eb 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -33,11 +33,14 @@ const { title, cover = '/assets/images/branding/og/bonsai.jpg', } = Astro.props; + +const processedCover = cover.endsWith('.webp') ? cover.replace(/\.webp$/, '.jpg') : cover; + const currentPath = new URL(Astro.request.url).pathname; const fullTitle = `${title} ยท ${site.description}`; const fullDescription = description || site.description; const fullUrl = site.url + currentPath; -const fullImage = site.url + cover; +const fullImage = site.url + processedCover; const schema = JSON.stringify({ '@context': 'https://schema.org/',