aboutsummaryrefslogtreecommitdiff
path: root/pages/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'pages/index.tsx')
-rw-r--r--pages/index.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index d2be08e..634950d 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -68,7 +68,10 @@ export default function Home(props: {
{index == 0 && <>
<h2>Recent posts</h2>
<div className='recentPosts'>
- {posts.posts.reverse().slice(0, 4).map(post => {
+ {posts.posts.sort((a, b) => (
+ new Date(a.date).getTime() -
+ new Date(b.date).getTime()
+ )).reverse().slice(0, 4).map(post => {
return <PostCard post={post} />;
})}
</div>