I am trying to make a card-based layout where different types (using type-filter) has a slightly different design, however, I want them to go in the same grid and sorted by date, irregardless of type, so the latest are always first.
I am struggling with how to code this up with hugo. I tried using range, with nested if’s but that does not work. I have also looked at where and nested where, but I cannot find the proper way to do it.
I looked at those as well, but I am not sure it acheives what I want.
I’ll try to illustrate.
{{ range where .Site.Pages "Section" "blog"}}
{{ if "type" eq "podcast" }}
Do something
{{ elseif "type" eq "link"}}
Do something
{{end}}
{{else}}
Do the general thing
{{ end }}