Sort blog posts by publication date

This commit is contained in:
2025-05-23 19:34:19 +02:00
parent 54986f6edf
commit 1d614247b9

View File

@@ -40,7 +40,10 @@ func getAllPosts() []Post {
posts = append(posts, makePost(post))
}
//fmt.Println(posts[0].UpdatedDate.IsZero())
sort.Slice(posts, func(i, j int) bool {
return posts[i].Date.After(posts[j].Date)
})
return posts
}