mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-24 19:21:31 +08:00
feat: new blog layout and props
This commit is contained in:
@ -12,7 +12,7 @@ export async function getAllPosts(): Promise<CollectionEntry<"post">[]> {
|
||||
*/
|
||||
export function groupPostsByYear(posts: CollectionEntry<"post">[]) {
|
||||
return posts.reduce<Record<string, CollectionEntry<"post">[]>>((acc, post) => {
|
||||
const year = post.data.publishDate.getFullYear();
|
||||
const year = post.data.date.getFullYear();
|
||||
if (!acc[year]) {
|
||||
acc[year] = [];
|
||||
}
|
||||
|
Reference in New Issue
Block a user