feat: generate og images in png format (#43)

* feat: generate og images in png format

In production mode, generate og images from svg to png format.

fix #40

* refactor: update og image format from svg to png

Update OG image format in post detail to png. Update twitter og images to auto-generated dynamic og
images.
This commit is contained in:
Sat Naing
2023-03-01 18:46:42 +06:30
committed by GitHub
parent c40af432a0
commit 27507d1d78
6 changed files with 320 additions and 11 deletions
+1 -8
View File
@@ -24,8 +24,6 @@ const socialImageURL = new URL(
ogImage ? ogImage : SITE.ogImage,
Astro.url.origin
).href;
const fallbackImageURL = new URL(SITE.ogImage, Astro.url.origin).href;
---
<!DOCTYPE html>
@@ -54,12 +52,7 @@ const fallbackImageURL = new URL(SITE.ogImage, Astro.url.origin).href;
<meta property="twitter:url" content={canonicalURL} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta
property="twitter:image"
content={socialImageURL.endsWith(".svg")
? fallbackImageURL
: socialImageURL}
/>
<meta property="twitter:image" content={socialImageURL} />
<!-- Google Font -->
<link rel="preconnect" href="https://fonts.googleapis.com" />