Skip to content

Commit

Permalink
feat(get-sorted-posts): use velite Post as post type
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Feb 24, 2024
1 parent c90ebef commit 6ede02b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/get-sorted-posts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Post } from 'contentlayer/generated'
import { Post } from '#content'

export function getSortedPosts(posts: Post[]) {
return posts.sort(
(a, b) => Number(new Date(b.date)) - Number(new Date(a.date))
)
return posts.sort((a, b) => Number(b.date) - Number(a.date))
}

0 comments on commit 6ede02b

Please sign in to comment.