mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
b9bd35d72e
git-subtree-dir: docs git-subtree-split: fdea5430f89dfd849d39212abdf5ace0a4763e5a
802 B
802 B
title | description | date | categories | menu | keywords | signature | workson | hugoversion | relatedfuncs | aliases | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
append | `append` appends one or more values to a slice and returns the resulting slice. | 2018-09-14 |
|
|
|
|
0.49 |
|
An example appending single values:
{{ $s := slice "a" "b" "c" }}
{{ $s = $s | append "d" "e" }}
{{/* $s now contains a []string with elements "a", "b", "c", "d", and "e" */}}
The same example appending a slice to a slice:
{{ $s := slice "a" "b" "c" }}
{{ $s = $s | append (slice "d" "e") }}
The append
function works for all types, including Pages
.