Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordering of posts #18

Closed
kHarshit opened this issue Nov 15, 2019 · 2 comments
Closed

Ordering of posts #18

kHarshit opened this issue Nov 15, 2019 · 2 comments

Comments

@kHarshit
Copy link

Hi, I want the posts to display in the same order as they were posted (chronologically), not alphabetically. How do I do that? e.g. https://kharshit.github.io/poems/

{% assign pages_list = site.pages | sort:"url" %}

Removing sort: "url" didn't help!

@kHarshit
Copy link
Author

kHarshit commented Nov 15, 2019

Update: Adding sort: "date" and date field to posts (texts) sorted the posts chronologically.

something like this:

---
layout: poem
date: 2010-11-15 20:19 +05:30
---

Now, the posts are in chronological order though I want them to be reversed, it doesn't work even if add reversed.

{% for node in pages_list reversed %}

@karlstolley
Copy link
Member

@kHarshit you'll want to read through the Jekyll docs to help you understand how to set the sorting of your collections. You're referencing site.pages, which is different from a custom collection: https://jekyllrb.com/docs/collections/#custom-sorting-of-documents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants