From: Ariejan de Vroom Date: Wed, 10 Jun 2015 22:12:27 +0000 (+0200) Subject: Update docs for `last` template function X-Git-Tag: v0.15~342 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cc9536ec46fe76697b7d1d3f95d40d7dc9d35bf5;p=brevno-suite%2Fhugo Update docs for `last` template function --- diff --git a/docs/content/templates/functions.md b/docs/content/templates/functions.md index a731f698..83ba9017 100644 --- a/docs/content/templates/functions.md +++ b/docs/content/templates/functions.md @@ -76,11 +76,24 @@ e.g. {{ .Render "summary" }} {{ end }} +### last +Slices an array to only the last X elements. + +Works on [lists](/templates/list/), [taxonomies](/taxonomies/displaying/), [terms](/templates/terms/), [groups](/templates/list/) + +e.g. + + {{ range last 10 .Data.Pages }} + {{ .Render "summary" }} + {{ end }} + ### after Slices an array to only the items after the Xth item. Use this in combination with `first` use both halves of an array split a item X. +Works on [lists](/templates/list/), [taxonomies](/taxonomies/displaying/), [terms](/templates/terms/), [groups](/templates/list/) + e.g. {{ range after 10 .Data.Pages }}