refactor: display only non-featured posts in Recent Section

This commit is contained in:
satnaing
2023-09-14 14:01:04 +06:30
committed by Sat Naing
parent cbdaa59bae
commit 08e4f545a0
+12 -10
View File
@@ -92,16 +92,18 @@ const socialCount = SOCIALS.filter(social => social.active).length;
<h2>Recent Posts</h2>
<ul>
{
sortedPosts.map(
({ data }, index) =>
index < 4 && (
<Card
href={`/posts/${slugify(data)}`}
frontmatter={data}
secHeading={false}
/>
)
)
sortedPosts
.filter(({ data }) => !data.featured)
.map(
({ data }, index) =>
index < 4 && (
<Card
href={`/posts/${slugify(data)}`}
frontmatter={data}
secHeading={false}
/>
)
)
}
</ul>
<div class="all-posts-btn-wrapper">