Skip to content

Commit

Permalink
fix: display the latest blog
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave-lab12 committed Oct 5, 2023
1 parent bad10fd commit c152c56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/blog/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const getBlogs = async () => {
};
const blogs = await getBlogs();
const firstPost = blogs?.slice(-1)[0];
const latestBlog = blogs ? blogs[0] : null;
const blogsWithoutFirstPost = blogs?.filter(
(blog) => blog.id !== firstPost?.id
(blog) => blog.id !== latestBlog?.id
);
---

<Layout title="Blog">
<Hero {...firstPost} />
<Hero {...latestBlog} />
<div class="pb-4">
<ResponsiveCards gap="112px" width="580px">
{
Expand Down

0 comments on commit c152c56

Please sign in to comment.