collections.First

{{ range first 5 .Pages }}
  {{ .Render "summary" }}
{{ end }}

N 設為 0 可以返回一個空的集合。

{{ $emptyPageCollection := first 0 .Pages}}

結合 firstwhere 使用。

{{ range where .Pages "Section" "articles" | first 5 }}
  {{ .Render "summary" }}
{{ end }}