Manually Ordering Documents in Collections

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

what version of jekyll? I had not seen that info before (sorting collections), and in looking at the documentation version control it looks like that part is for version 4 that was just released.

Bingpot! Thanks @rdyar, that must be it. Didn’t even think to look to the release notes as I’m new-is to Jekyll and ran across the need to custom sort collections just in the last few days - clearly after I installed a slightly older version of Jekyll when I started my project, but before 4.0 came out. Looking at the release notes, this was definitely new:

  • Allow custom sorting of collection documents (#7427)

Upgrading to 4.0 will take a bit longer than I have to commit at the moment, but I now know what I need to do to resolve. Thanks so much for your help!

Follow-up, I upgraded to Jekyll 4 and the manual sorting via the config file works!