From ef1fac60434f1a1eba55c367f206edb7ceb57c86 Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Fri, 23 Sep 2022 13:30:58 +0630 Subject: [PATCH] Set default og image even when empty string is specify --- src/layouts/Layout.astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 55ce003..a34b3e1 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -17,7 +17,10 @@ const { } = Astro.props; const canonicalURL = new URL(Astro.url.pathname, Astro.site); -const socialImageURL = new URL(ogImage, Astro.url.origin); +const socialImageURL = new URL( + ogImage ? ogImage : SITE.ogImage, + Astro.url.origin +); ---