Skip to content

Commit

Permalink
Merge pull request danielcgilibert#33 from Celqaz/main
Browse files Browse the repository at this point in the history
Update post.ts to properly return the latest post
  • Loading branch information
danielcgilibert authored Oct 30, 2023
2 parents 4ff66a1 + 091ce64 commit 3f072b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const getCategories = async () => {
export const getPosts = async (max?: number) => {
return (await getCollection('blog'))
.filter((post) => !post.data.draft)
.sort((a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf())
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf())
.slice(0, max)
}

Expand Down

0 comments on commit 3f072b8

Please sign in to comment.