Custom Sort order of Pages

By default, Hugo sorts by Weight, then by Date, then Link Title and finally by File path.

Is is possible to change that order ? Take Date > Title > Weight as an example. Can I iterate through those pages in that custom “order” ?

If it is possible, can I input a list of params in my config.toml file that I want to sort by ?

Thanks for all the help !

No. You cannot customize the internal sorting order.

You cannot sort content by Parameters defined in the global context (a project’s config).
You can sort content by Parameters that are defined in the content files’ frontmatter.

However Hugo does have an internal mainSections method. Read about it over here

Oh ok. Changing the internal sorting order would have been a good feature. Thank you for you help !

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.