Skip to content

Commit 7e975ae

Browse files
authored
perf(images): use webp format and 80% quality for embedded images (#57)
1 parent 7e77177 commit 7e975ae

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/PostCard.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const formattedDate = date.toLocaleDateString('en-US', {
3030
alt={title}
3131
width={1920}
3232
height={1080}
33-
quality={100}
34-
format="png"
33+
quality={80}
34+
format="webp"
3535
class="w-full h-full object-cover hover:scale-105 transition-transform duration-300"
3636
loading="lazy"
3737
/>

src/layouts/PostLayout.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ const ogImageUrl = image?.src;
5858
<Image
5959
src={image}
6060
alt={title}
61+
quality={80}
62+
format="webp"
6163
class="w-full"
6264
/>
6365
</div>

0 commit comments

Comments
 (0)