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 committed Oct 24, 2023
1 parent 0d45e15 commit 5c598e9
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 5c598e9

Please sign in to comment.