mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-12 14:28:09 +02:00
feat(content-blog): allow sorting posts in ascending order (#5787)
This commit is contained in:
parent
8fba542d26
commit
1c024470e0
5 changed files with 20 additions and 0 deletions
|
@ -294,6 +294,9 @@ export async function generateBlogPosts(
|
|||
(a, b) => b.metadata.date.getTime() - a.metadata.date.getTime(),
|
||||
);
|
||||
|
||||
if (options.sortPosts === 'ascending') {
|
||||
return blogPosts.reverse();
|
||||
}
|
||||
return blogPosts;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue