mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Update docs for last
template function
This commit is contained in:
parent
0a2e5424ab
commit
cc9536ec46
1 changed files with 13 additions and 0 deletions
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue