Skip to content

How to order pages in a collection in reverse chronological order #2720

Answered by george-gca
ktatar asked this question in Q&A
Discussion options

You must be logged in to vote

By default, two documents in a collection are sorted by their date attribute when both of them have the date key in their front matter, as written in the docs. Also, we already do sort a collection in an inverse order when generating the news part in the about page, so you just need to do the same for projects:

{% assign news = site.news | reverse %}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by george-gca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants