Sort order with non English characters

How can I sort pages by param when it contains non English characters? I would like to sort them according to the rules of the language (the languageCode is set in config.toml).

{{ Range sort .Data.Pages "Params.last_name" }}

You currently can not. There is (I think) and open issue about on GitHub, but it is no trival task to solve. If you think it is a trivial task, a Pull Request is welcomed.

I am afraid it is not a trivial task (especially for me). Thanks for your answer.

In other applications (non-Hugo), I used to deal with this problem with an additional field that contains the string in Western characters. This is particularly useful when you have to deal with characters that belong to different writing systems like Japanese and Korean.

So if you have the name in the original form, you would create another variable sort-name and write the name in transscription.

I do not know about other languages, but in Japanese, there are different indigenous sort orders, and it is difficult to decide which is relevant in which case. But more and more, alphabetical sort order has become common. So, it feels absolutely OK if Japanese names are sorted this way, and Korean and Chinese names fit in nicely.

So, since I am going to set up my site multilingual, I am planning to take this approach as well.

Thanks for sharing the tip. I have found another temporary solution: with JavaScript list.js library. When sorting problem will be fixed in Hugo, I’ll just delete a few lines of javascript code in one file.

Related issue: