I’m trying to sort a collection of pages that I have in this form:
{{ range .context.Pages }}
{{ .Title }}
{{ end }}
I would like this list to be iterated by reverse dateonly in a certain section of the site (e.g. the section ‘releases’).
I could create two partials, but I’m trying to learn a way that would have a conditional statement on this one, allowing to alter the .context.Pages fed to range in a way that’s self-contained to this partial, or even to the range block itself if possible.
A small note (for any newbie like me) is that the first line needs to be a declaration with assignment, hence := instead of =. The rest is exactly the type of example I was looking for.