Skip to content

Commit

Permalink
Add image alt and priority fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjapotocin committed Oct 26, 2023
1 parent 5e7af28 commit 4395874
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions components/Blog/BlogList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ export default function BlogList({
return (
<Styled.BlogList>
{blogs.map(
({ title, url, date, thumbImage, shortExcerpt, author, tags }) => (
(
{ title, url, date, thumbImage, shortExcerpt, author, tags },
index,
) => (
<Styled.BlogListItem key={url}>
{thumbImage && (
<Styled.BlogListImageWrapper>
<Link href={`blog/${url}`}>
<Image
priority={index < 3}
src={thumbImage.src}
width={thumbImage.width}
height={thumbImage.height}
alt=""
alt={title}
/>
</Link>
</Styled.BlogListImageWrapper>
Expand Down
3 changes: 2 additions & 1 deletion components/Blog/FeaturedBlog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export default function FeaturedBlog({
{thumbImage && (
<Link href={`blog/${url}`}>
<Image
priority
src={thumbImage.src}
width={thumbImage.width}
height={thumbImage.height}
alt=""
alt={title}
/>
</Link>
)}
Expand Down

0 comments on commit 4395874

Please sign in to comment.