# Better sorting for terms

**URL:** <https://zola.discourse.group/t/better-sorting-for-terms/2832>\
**Category:** Feature requests\
**Created:** [August 14, 2025, 1:33pm UTC](https://zola.discourse.group/t/better-sorting-for-terms/2832 "2025-08-14T13:33:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spence](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/spence/32/1022_2.png) [@spence](https://zola.discourse.group/u/spence)\
**Post date:** [August 14, 2025, 1:33pm UTC](https://zola.discourse.group/t/better-sorting-for-terms/2832/1 "2025-08-14T13:33:13Z")

</div>

Please let me know if I’m mistaken and there’s already a way to do what I’m asking. Basically, I would like a way to indicate how a term should be sorted.

To see what I mean, imagine there are taxonomies `title` and `authors` and there’s a page titled `the-winters-tale.md` as follows:

```md
+++
[taxonomies]
title = ["The Winter's Tale"]
authors = ["William Shakespeare"]
+++

```

How would one reliably sort this as Shakespeare, William? I don’t think there’s currently a good way to do this.

Of course you can store authors = [“Shakespeare, William”] , but then you don’t really have it in the `“{{ first }} {{ last }}"` format.

Furthermore, this is more of a hack than anything, as it wouldn’t work for many titles.

Imagine, for example, the term `“The Good, The Bad, and the Ugly”` for the `titles` taxonomy. This should be sorted like `”Good, The Bad, and The Ugly, The”`, but because commas are in the title you can’t really reliably do what worked before with author names.

The popular OSS book management software “calibre” has to deal with sorting a lot more than Zola, and so I think its solution could be good inspiration. It just has a separate key for title and author sort. See the image below:

 ![Screenshot 2025-08-14 at 15.29.06](https://global.discourse-cdn.com/free1/uploads/zola1/original/2X/d/d86d5f96bdcfdd6e5bcec138c9d770a1588327a7.png)

With this in mind, I think a similar approach could be used for taxonomical terms in Zola. It may look, for example, like this:

```md
+++
[[taxonomies.authors]]
term = "William Shakespeare"
sort = "Shakespeare, William"

taxonomies.title = ["The Winter's Tale"]
+++

```

This would allow there to be the term as you’d like it displayed, as well as the canonical way to sort this. Additionally, in my example the `title` taxonomy remains an array of strings, like how it is today. The idea is both would work, with the `term` + `sort` keys being optional.

I believe something like this would be very useful for the project, in particular when working in taxonomies, although the idea could be extended to page titles as well and even made to integrate with the [page sorting](https://www.getzola.org/documentation/content/section/#sorting-pages) options that are provides already.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [August 27, 2025, 11:28am UTC](https://zola.discourse.group/t/better-sorting-for-terms/2832/2 "2025-08-27T11:28:55Z")

</div>

I think that makes sense
