mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Merge commit '7c62d6ef1654c0383eae474d3bd9ddf7754c1f30'
This commit is contained in:
@@ -26,4 +26,12 @@ The same example appending a slice to a slice:
|
||||
{{ $s = $s | append (slice "d" "e") }}
|
||||
```
|
||||
|
||||
If a slice contains other slices, further slices will be appended as values:
|
||||
|
||||
```go-html-template
|
||||
{{ $s := slice (slice "a" "b") (slice "c" "d") }}
|
||||
{{ $s = $s | append (slice "e" "f") (slice "g" "h") }}
|
||||
{{/* $s now contains a [][]string containing four slices: ["a" "b"], ["c" "d"], ["e" "f"], and ["g" "h"] */}}
|
||||
```
|
||||
|
||||
The `append` function works for all types, including `Pages`.
|
||||
|
Reference in New Issue
Block a user