I have a collection in my jekyll site that has files named as numbers. 1, 2, 3, ... 10, 11, 12, and so on. I'm building these pages to connect with each other, so 1 would connect to 2, ...
When I build, jekyll serves it in the order of 1, 10, 11, 12, 2, 3, ...
How can I have it build in proper numerical order?
After a little more searching, I found this answered question: How to change the default order pages in jekyll
Basically, what I came up with was:
{% assign ordered_pages = site.pages | sort:"title" %}
{% for page in ordered_pages %}
<a href="{{ page.url | relative_url }}">{{ page.title }}</a>
{% endfor %}
Which is nearly identical to the original answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With