Allowing sorting by title

I am having a use case where it would be valuable for me to sort sections by the title in the front matter. Meaning sorting in alphabetical order.

After looking through the code base, I figured I could probably implement this change.

There are two hurdles I see:

  1. I would probably add another pair in the same sense as page.later/page.earlier and page.heavier/page.lighter. I saw in this pull request that page.next and page.previous was removed. When sorting by title I would probably reintroduce them. I welcome any and all suggestions about better semantics.

  2. Is this something only I would have use for? I couldn’t see any other issues regarding this and I don’t know if this possibility exists in other static site generators.

Would this change be something that would be appreciated?

2 Likes

Sort by title would be useful for me. Also, would love to be able to sort by any metadata/frontmater on the page. I’ve got an item under [extra] that I’d like to sort by.

1 Like

I also need sorting by title. I have a section of my site that has a list of terms, so it is natural for its index page to sort the terms by title.

I’ve implemented sorting by title on my Zola fork:

PR created at Add sort_by title by xpe · Pull Request #1315 · getzola/zola · GitHub

2 Likes