# Manually Ordering Documents in Collections

**URL:** <https://talk.jekyllrb.com/t/manually-ordering-documents-in-collections/3232>\
**Category:** Help\
**Created:** [August 22, 2019, 11:28pm UTC](https://talk.jekyllrb.com/t/manually-ordering-documents-in-collections/3232 "2019-08-22T23:28:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![breyman](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/breyman/32/1851_2.png) [@breyman](https://talk.jekyllrb.com/u/breyman)\
**Post date:** [August 22, 2019, 11:28pm UTC](https://talk.jekyllrb.com/t/manually-ordering-documents-in-collections/3232/1 "2019-08-22T23:28:00Z")

</div>

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/](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:

```auto
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:

```auto
{% assign my-portfolio-list = site.portfolio_items | sort: 'order' %}
      {% for my-portfolio in my-portfolio-list %}
       // processing code
      {% endfor %}

```

And this:

```auto
      {% for my-portfolio in site.portfolio_items %}
       // processing code
      {% endfor %}

```

Thanks for any insight!  
Brian

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 23, 2019, 1:33am UTC](https://talk.jekyllrb.com/t/manually-ordering-documents-in-collections/3232/2 "2019-08-23T01:33:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![breyman](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/breyman/32/1851_2.png) [@breyman](https://talk.jekyllrb.com/u/breyman)\
**Post date:** [August 23, 2019, 1:56am UTC](https://talk.jekyllrb.com/t/manually-ordering-documents-in-collections/3232/3 "2019-08-23T01:56:27Z")

</div>

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](https://github.com/jekyll/jekyll/pull/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!

---

<div class="post-metadata">

**Author:** ![breyman](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/breyman/32/1851_2.png) [@breyman](https://talk.jekyllrb.com/u/breyman)\
**Post date:** [August 24, 2019, 1:02am UTC](https://talk.jekyllrb.com/t/manually-ordering-documents-in-collections/3232/4 "2019-08-24T01:02:50Z")

</div>

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