mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
734 B
734 B
title, description, categories, menu, keywords, signature, relatedfuncs
title | description | categories | menu | keywords | signature | relatedfuncs | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
append | `append` appends one or more values to a slice and returns the resulting slice. |
|
|
|
|
|
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
.