feat: new blog layout and props

This commit is contained in:
KazooTTT
2025-02-05 15:27:29 +08:00
parent ea645368e9
commit fea129eb98
12 changed files with 36 additions and 50 deletions

View File

@ -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] = [];
}