@@ -204,7 +204,9 @@ export default function StaticMarkdownPage({
204
204
width = { 800 }
205
205
height = { 450 }
206
206
className = 'object-cover w-full h-full opacity-70 blur-[5px]'
207
- alt = 'hero image example'
207
+ alt = { recentBlog [ 0 ] . frontmatter . title }
208
+ priority
209
+ quality = { 75 }
208
210
/>
209
211
< div className = 'absolute text-white w-full h-full mt-custom ml-14' >
210
212
{ /* Display all categories (joined by comma) */ }
@@ -298,7 +300,7 @@ export default function StaticMarkdownPage({
298
300
299
301
{ /* Blog Posts Grid */ }
300
302
< div className = 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-6 grid-flow-row mb-20 bg-white dark:bg-slate-800 mx-auto p-4' >
301
- { sortedFilteredPosts . map ( ( blogPost : any ) => {
303
+ { sortedFilteredPosts . map ( ( blogPost : any , idx : number ) => {
302
304
const { frontmatter, content } = blogPost ;
303
305
const date = new Date ( frontmatter . date ) ;
304
306
const postTimeToRead = Math . ceil ( readingTime ( content ) . minutes ) ;
@@ -310,12 +312,15 @@ export default function StaticMarkdownPage({
310
312
href = { `/blog/posts/${ blogPost . slug } ` }
311
313
className = 'inline-flex flex-col flex-1 w-full'
312
314
>
313
- < div className = 'h-max-[200px] w-full object-cover' >
314
- < div
315
- className = 'bg-slate-50 h-[160px] w-full self-stretch mr-3 bg-cover bg-center'
316
- style = { {
317
- backgroundImage : `url(${ frontmatter . cover } )` ,
318
- } }
315
+ < div className = 'relative h-[160px] w-full' >
316
+ < Image
317
+ src = { frontmatter . cover }
318
+ alt = { frontmatter . title }
319
+ fill
320
+ className = 'object-cover'
321
+ loading = { idx < 10 ? 'eager' : 'lazy' }
322
+ priority = { idx < 10 }
323
+ quality = { 75 }
319
324
/>
320
325
</ div >
321
326
< div className = 'p-4 flex flex-col flex-1 justify-between' >
0 commit comments