"Fossies" - the Fresh Open Source Software Archive

Member "hugo-0.113.0/docs/content/en/functions/append.md" (5 Jun 2023, 734 Bytes) of package /linux/www/hugo-0.113.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the last Fossies "Diffs" side-by-side code changes report for "append.md": 0.111.3_vs_0.112.0.

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.