I’d like to sort my events by date, and show only the 5 last ones.
Doing that way:
{{ range first 5 (sort .Site.Sections.event.Pages.ByDate) }}
{{ if ge .Date.Unix .Now.Unix }}
{{ .Render “short” }}
{{ end }}
{{ end }}
If I have events with a date < now, they are counted in the 5. I couldn’t find a way to use a where statement with sort.
thanks