Looking to manually order an index of documents in a collection. I’m following the Manually Ordering Document section at https://jekyllrb.com/docs/collections/ but can’t get them to order anything but alphabetically in practice.
I tried placing an index in each page’s front matter, which does work, but that approach is much more time-consuming to manage than using a manual index in _config, as suggested by the above documentation.
What am I doing wrong or missing?
A few snippets of the most applicable code:
From _config:
collections:
portfolio_items:
output: true
permalink: "/portfolio/:slug/"
order:
- stopmotion-edc.html
- craftiv.html
- ios-sticker-app.html
From the index page, I’ve tried two approaches, both of which only help alphabetically by file name, neither of which help with accessing the custom order in _config.
Tried this:
{% assign my-portfolio-list = site.portfolio_items | sort: 'order' %}
{% for my-portfolio in my-portfolio-list %}
// processing code
{% endfor %}
And this:
{% for my-portfolio in site.portfolio_items %}
// processing code
{% endfor %}
Thanks for any insight!
Brian