fix little issues

This commit is contained in:
2024-01-25 21:54:49 -05:00
parent 76231e5d6b
commit 29f02667f4
6 changed files with 24 additions and 12 deletions
+5 -1
View File
@@ -11,7 +11,11 @@ const posts = await getCollection('blog');
<Layout title="Home">
{
posts
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
.sort(
(a, b) =>
new Date(b.data.pubDate).valueOf() -
new Date(a.data.pubDate).valueOf()
)
.slice(0, 5)
.map((post) => <PostPreview post={post} />)
}