mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-22 02:01:32 +08:00
feat: add rss
This commit is contained in:
@ -8,6 +8,10 @@ export async function getAllPosts() {
|
||||
})
|
||||
}
|
||||
|
||||
export async function getAllSortedPosts() {
|
||||
return sortMDByDate(await getAllPosts())
|
||||
}
|
||||
|
||||
export function sortMDByDate(posts: Array<CollectionEntry<'post'>>) {
|
||||
return posts.sort((a, b) => {
|
||||
const aDate = new Date(a.data.date).valueOf()
|
||||
|
Reference in New Issue
Block a user