File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/astro-theme/layouts Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import BlogPostCardSet from "../components/BlogPostCardSet.astro";
1212import { resolveAuthors } from " ../lib/blog" ;
1313import LinkButton from " ../components/LinkButton.astro" ;
1414import { DISCORD_URL } from " ../consts" ;
15- import { Image } from " astro:assets" ;
15+ import { Image , getImage } from " astro:assets" ;
1616import { productFromUrl } from " ../lib/products" ;
1717import ProductNav from " ../components/nav/product/Nav.astro" ;
1818
@@ -33,9 +33,20 @@ let titleAndSubtitle = title;
3333if (subtitle ) {
3434 titleAndSubtitle += ` : ${subtitle } ` ;
3535}
36+
37+ // Generate optimized social preview image using the same optimization as the hero image
38+ const socialImage = heroImage
39+ ? await getImage ({
40+ src: heroImage ,
41+ width: 1232 ,
42+ height: 480 ,
43+ quality: " max" ,
44+ format: " jpg" ,
45+ })
46+ : undefined ;
3647---
3748
38- <Shell title ={ titleAndSubtitle } {description } image ={ heroImage ?.src } >
49+ <Shell title ={ titleAndSubtitle } {description } image ={ socialImage ?.src } >
3950 { product && <ProductNav { product } />}
4051 <main class =" px-6 py-10 w-full max-w-screen-xl mx-auto" >
4152 <a
You can’t perform that action at this time.
0 commit comments