Hi all!
When I range through .Resources
like this, the images are automatically ordered alphabetically:
{{ range $image := (.Page.Resources.ByType "image") }}
Yet, when I sort by a year param (some image have the same year
param, e.g. “2020”) the secondary sorting is not alphabetically but seems arbitrary:
{{ range $image := sort (.Page.Resources.ByType "image") ".Params.year" "desc" }}
- 2020 b
- 2020 a
- 2020 c
Unfortunately it does not seem seems to be possibly nest the sorting like this:
{{ range $image := sort (sort (.Page.Resources.ByType "image") ".Name") ".Params.year" "desc" }}
and .ByParam
does not work with Page Resources.
Does anyone have an idea how to use nested sorting for page resouces?