Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

How to sort posts by numbers, dates, or alphabetically? #455

Open
jackcrane opened this issue Apr 13, 2023 · 1 comment
Open

How to sort posts by numbers, dates, or alphabetically? #455

jackcrane opened this issue Apr 13, 2023 · 1 comment

Comments

@jackcrane
Copy link

I have my pages organized by chapter numbers, some exemplified below

8.4.1: Some words
[...]
9.5.2: Some more words
[...]
10.1.0: Another words

They should be in that order, but instead 10.1.0 gets sorted before anything else. Is there some way to EITHER organize by numbers OR provide a "rank" in frontmatter that it gets sorted by?

@Thunder33345
Copy link
Contributor

Thunder33345 commented Apr 26, 2023

You can manually configure reorder of a post in the frontmatter using "weight" parameter, unfortunately i dont think there's another way apart from manually assign weight for each post.

This is not a theme feature, so see Hugo docs on frontmatter

weight
used for ordering your content in lists. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an unset weight.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants