For the sake of this example, let’s assume we have a collection called projects
.
Here is how we can get a collection posts in ascending order on a page or index (oldest collection post first).
Sorting a Jekyll collection in reverse order (latest collection post first) is pretty straightforward in Jekyll.
Now let’s look at how we can limit the number of posts from a collection and sort the result in descending order (latest collection post first). This is useful if you have a site with hundred of articles and want to create an index with the latest results in a given collection.
If you leave out | reverse
, your collection will show up oldest post first.
Note that these snippets don’t give you a pagination system.