Set default og image even when empty string is specify

This commit is contained in:
Sat Naing
2022-09-23 13:30:58 +06:30
parent aafcc4ae28
commit ef1fac6043
+4 -1
View File
@@ -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
);
---
<!DOCTYPE html>