Skip to content

Commit 72e354f

Browse files
committed
add eager to first image
1 parent 8c4e649 commit 72e354f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/blog.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ console.log(posts[0].frontmatter.image);
2626
<main class="mt-16">
2727
<ul class="grid gap-16 max-w-4xl mx-auto">
2828
{
29-
posts.map((post) => (
29+
posts.map((post, index) => (
3030
<li>
3131
<a href={post.url}>
3232
<div class="grid md:grid-cols-2 gap-5 md:gap-10 items-center">
@@ -36,6 +36,7 @@ console.log(posts[0].frontmatter.image);
3636
sizes="(max-width: 800px) 100vw, 800px"
3737
aspectRatio="16:9"
3838
alt="Thumbnail"
39+
loading={index === 0 ? "eager" : "lazy"}
3940
class="w-full rounded-md aspect-video"
4041
/>
4142
<div>

0 commit comments

Comments
 (0)