Is there currently a way to exclude a given section from a list? Thanks to ‘where’, I can list only a given section, like this:
{{ range first 5 (where .Data.Pages "Section" "status") }}
{{ .Content }}
{{ end }}
But is there a way for me to e.g. then list all pages except those in section status?
The real context for this is that I have a “status” section of brief status messages which I display at the top of the home page, and then want to display the list of full posts & pages (everything that is not in section “status”) below that.
The work-around, obviously, is to give all status messages an ancient date, so they don’t appear in the list, but I’m wondering if there’s another way.
{{ range .Data.Pages }}
{{ if neq .Section "status" }}
{{.Content}}
{{end}}
{{end}}
The only problem comes when you want to list only a certain number of them, since range first N will return N, but then you’ll possibly strip out some of those because they’re status messages. But if you don’t need to do that, it’s pretty simple.