mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-24 03:01:31 +08:00
feat: add rss
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
export { cn } from './tailwind'
|
||||
export {
|
||||
getAllPosts,
|
||||
getAllSortedPosts,
|
||||
sortMDByDate,
|
||||
getUniqueTags,
|
||||
getUniqueTagsWithCount,
|
||||
|
@ -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