[Solved] List recent pages not properly functioning with weight?

I have setup a website with weights for some posts.

The command

{{ range first 10 .Site.Pages }}

turns out not listing pages with time order. But instead weight is considered more important and time ordering only appears for the posts with the same weight.

This is different from what mentioned here https://gohugo.io/templates/variables/ where it says the ordering is according to date. According to date instead of weight is more logical (and at least should be an available option) because if the sidebar is called “recent posts”, it should actually list the recent posts.

Is it a bug or any way out? Thanks!

Figured out myself :slightly_smiling:

{{ range first 5 .Site.Pages.ByDate.Reverse }}

1 Like