File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,13 @@ const {
19
19
} = Astro .props ;
20
20
21
21
const canonicalURL = new URL (Astro .url .pathname , Astro .site );
22
+
22
23
const socialImageURL = new URL (
23
24
ogImage ? ogImage : SITE .ogImage ,
24
25
Astro .url .origin
25
- );
26
+ ).href ;
27
+
28
+ const fallbackImageURL = new URL (SITE .ogImage , Astro .url .origin ).href ;
26
29
---
27
30
28
31
<!DOCTYPE html >
@@ -51,7 +54,12 @@ const socialImageURL = new URL(
51
54
<meta property =" twitter:url" content ={ canonicalURL } />
52
55
<meta property =" twitter:title" content ={ title } />
53
56
<meta property =" twitter:description" content ={ description } />
54
- <meta property =" twitter:image" content ={ socialImageURL } />
57
+ <meta
58
+ property =" twitter:image"
59
+ content ={ socialImageURL .endsWith (" .svg" )
60
+ ? fallbackImageURL
61
+ : socialImageURL }
62
+ />
55
63
56
64
<!-- Google Font -->
57
65
<link rel =" preconnect" href =" https://fonts.googleapis.com" />
You can’t perform that action at this time.
0 commit comments