random thoughts and discoveries

Hugo - sort by multiple fields

As I started working with Hugo, my main bottleneck was the default article sorting.

Hugo default sorting is Weight > Date > LinkTitle > FilePath. While this could be useful, the Date always messes up a list if you want to have a website and not a blog.

My issue was that sorting by title using .Pages.ByTitle on a range wasn’t enough. I still wanted to have Weight first and then the Title.