feat: add rss

This commit is contained in:
KazooTTT
2024-11-23 16:51:13 +08:00
parent 01c70257a1
commit 790c91c342
7 changed files with 22 additions and 6 deletions

View File

@ -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()