Bylastmod sorting weirdly?

I’m a little new to this Hugo thing, but I was trying to implement the following code:

{{$notes := $.Site.RegularPages.ByLastmod.Reverse }}

But when I listed these pages I noticed that the ordering of them were quite peculiar.

I’ve unfortunately not been able to check this recently, so I may be mixing up the order, but for the pages produced by that line of code, the months are ordered correctly, but the days are not (Once again, I may be mixing up the order, so it may be that the days are ordered correctly but the months are not).

Is there any workaround to this? I want to be able to order pages in a way that the most recently modified page is first (i.e. what I’d assume to be the intended result of ByLastmod.Reverse).

Thanks if any of you decide to look into this.

So, the sorting logic is correct. If what you see isn’t as expected, you need to check your data (e.g. the lastMod dates)

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