Skip to content

Commit

Permalink
refactor(blog-plugin): blog archive reverse ordering of posts (#9438)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Oct 24, 2023
1 parent 911dfb4 commit f80e1bd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function YearsSection({years}: {years: YearProp[]}) {
}

function listPostsByYears(blogPosts: readonly ArchiveBlogPost[]): YearProp[] {
const postsByYear = blogPosts.reduceRight((posts, post) => {
const postsByYear = blogPosts.reduce((posts, post) => {
const year = post.metadata.date.split('-')[0]!;
const yearPosts = posts.get(year) ?? [];
return posts.set(year, [post, ...yearPosts]);
Expand Down

0 comments on commit f80e1bd

Please sign in to comment.