Skip to content

Commit

Permalink
Sort posts by date most recent first.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jun 18, 2024
1 parent 4c22cbf commit 532a6be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/utils/mdx/fetchPostsMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export function fetchPostsMetadata(folder: string): PostMetadata[] {

posts = posts.filter((post) => post.published);

return posts;
return posts.sort((a, b) => {
return new Date(b.date).getTime() - new Date(a.date).getTime();
});
}


Expand Down

0 comments on commit 532a6be

Please sign in to comment.