11---
2+ import { Image } from ' astro:assets' ;
23import BaseLayout from ' ../layouts/BaseLayout.astro' ;
34import PostCard from ' ../components/PostCard.astro' ;
45import GitHubIcon from ' ../components/icons/GitHubIcon.astro' ;
56import { getCollection } from ' astro:content' ;
67import { SITE_TITLE , SITE_DESCRIPTION , SITE_URL , SOCIAL } from ' ../consts' ;
8+ import logo from ' ../../public/images/furystack-logo-512.png' ;
79
810const allPosts = await getCollection (' posts' , ({ data }) => ! data .draft );
911const posts = allPosts .sort ((a , b ) => b .data .date .valueOf () - a .data .date .valueOf ());
@@ -15,7 +17,7 @@ const ogImage = `${SITE_URL}/images/blog-cover.png`;
1517<BaseLayout title ={ SITE_TITLE } description ={ SITE_DESCRIPTION } ogImage ={ ogImage } isHome >
1618 <section class =" hero" >
1719 <div class =" hero-inner" >
18- <img class =" hero-logo" src =" /images/furystack- logo-512.png " alt ={ SITE_TITLE } width =" 64 " height =" 64 " />
20+ <Image class =" hero-logo" src ={ logo } alt ={ SITE_TITLE } width ={ 64 } height ={ 64 } loading = " eager " />
1921 <h1 class =" hero-title" >FuryStack</h1 >
2022 <p class =" hero-description" >{ SITE_DESCRIPTION } </p >
2123 <div class =" hero-actions" >
@@ -33,15 +35,15 @@ const ogImage = `${SITE_URL}/images/blog-cover.png`;
3335 { featured && (
3436 <section class = " featured-section" >
3537 <span class = " section-label" >Latest</span >
36- <PostCard post = { featured } large />
38+ <PostCard post = { featured } large eager />
3739 </section >
3840 )}
3941
4042 { rest .length > 0 && (
4143 <section class = " posts-section" >
4244 <span class = " section-label" >All Posts</span >
4345 <div class = " posts-grid" >
44- { rest .map (post => <PostCard post = { post } />)}
46+ { rest .map (( post , i ) => <PostCard post = { post } eager = { i < 3 } />)}
4547 </div >
4648 </section >
4749 )}
0 commit comments