+
+
+ )}
Published: {formatDate(blog.publishedDate)}
diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx index d4aa1b6..de4e125 100644 --- a/src/pages/HomePage.jsx +++ b/src/pages/HomePage.jsx @@ -30,6 +30,11 @@ function HomePage() { }); }; + const getImageUrl = (imagePath) => { + const baseUrl = import.meta.env.BASE_URL; + return imagePath ? `${baseUrl}${imagePath}` : null; + }; + const filteredBlogs = blogs.filter(blog => !searchQuery || blog.keywords.some(keyword => keyword.toLowerCase().includes(searchQuery.toLowerCase()) @@ -80,6 +85,15 @@ function HomePage() { className="blog-card-link" >
+
+
+ )}
{blog.title}
{blog.description}
diff --git a/src/utils/blogLoader.js b/src/utils/blogLoader.js index 2c3ec06..11f516c 100644 --- a/src/utils/blogLoader.js +++ b/src/utils/blogLoader.js @@ -41,7 +41,8 @@ export const loadBlogPosts = async () => { title: data.title, description: data.description, publishedDate: data.publishedDate, - keywords: data.keywords + keywords: data.keywords, + image: data.image // Add this line }); }
About
+