- zig
Name: Zig
styles:
+ - RPGLE
- abap
- algol
- algol_nu
- rose-pine
- rose-pine-dawn
- rose-pine-moon
- - rpgle
- rrt
- solarized-dark
- solarized-dark256
Description: |-
Append appends args up to the last one to the slice in the last argument.
This construct allows template constructs like this:
-
+
{{ $pages = $pages | append $p2 $p1 }}
-
+
Note that with 2 arguments where both are slices of the same type,
the first slice will be appended to the second:
-
+
{{ $pages = $pages | append .Site.RegularPages }}
Examples: []
Apply:
Description: |-
Complement gives the elements in the last element of ls that are not in
any of the others.
-
+
All elements of ls must be slices or arrays of comparable types.
-
+
The reasoning behind this rather clumsy API is so we can do this in the templates:
-
+
{{ $c := .Pages | complement $last4 }}
Examples:
- - '{{ slice "a" "b" "c" "d" "e" "f" | complement (slice "b" "c") (slice "d" "e") }}'
Index returns the result of indexing its first argument by the following
arguments. Thus "index x 1 2 3" is, in Go syntax, x[1][2][3]. Each
indexed item must be a map, slice, or array.
-
+
Adapted from Go stdlib src/text/template/funcs.go.
-
+
We deviate from the stdlib mostly because of https://github.com/golang/go/issues/14751.
Examples: []
Intersect:
Description: |-
Merge creates a copy of the final parameter in params and merges the preceding
parameters into it in reverse order.
-
+
Currently only maps are supported. Key handling is case insensitive.
Examples:
- - '{{ dict "title" "Hugo Rocks!" | collections.Merge (dict "title" "Default Title" "description" "Yes, Hugo Rocks!") | sort }}'
- args
Description: |-
Seq creates a sequence of integers from args. It's named and used as GNU's seq.
-
+
Examples:
-
+
3 => 1, 2, 3
1 2 4 => 1, 3
-3 => -1, -2, -3
- v2
Description: |-
Conditional can be used as a ternary operator.
-
+
It returns v1 if cond is true, else v2.
Examples:
- - '{{ cond (eq (add 2 2) 4) "2+2 is 4" "what?" | safeHTML }}'
Dump returns a object dump of val as a string.
Note that not every value passed to Dump will print so nicely, but
we'll improve on that.
-
+
We recommend using the "go" Chroma lexer to format the output
nicely.
-
+
Also note that the output from Dump may change from Hugo version to the next,
so don't depend on a specific output.
Examples:
- v
Description: |-
Humanize returns the humanized form of v.
-
+
If v is either an integer or a string containing an integer
value, the behavior is to add the appropriate ordinal.
Examples:
Description: |-
FormatAccounting returns the currency representation of number for the given currency and precision
for the current language in accounting notation.
-
+
The return value is formatted with at least two decimal places.
Examples:
- - '{{ 512.5032 | lang.FormatAccounting 2 "NOK" }}'
Description: |-
FormatCurrency returns the currency representation of number for the given currency and precision
for the current language.
-
+
The return value is formatted with at least two decimal places.
Examples:
- - '{{ 512.5032 | lang.FormatCurrency 2 "USD" }}'
so if you organize your resources in sub-folders, you need to be explicit about it, e.g.:
"images/*.png". To match any PNG image anywhere in the bundle you can do "**.png", and
to match all PNG images below the images folder, use "images/**.jpg".
-
+
The matching is case insensitive.
-
+
Match matches by using the files name with path relative to the file system root
with Unix style slashes (/) and no leading slash, e.g. "images/logo.png".
-
+
See https://github.com/gobwas/glob for the full rules set.
-
+
It looks for files in the assets file system.
-
+
See Match for a more complete explanation about the rules used.
Examples: []
Minify:
expression in content. Each element is a slice of strings holding the text
of the leftmost match of the regular expression and the matches, if any, of
its subexpressions.
-
+
By default all matches will be included. The number of matches can be
limited with the optional limit parameter. A return value of nil indicates
no match.
- s
Description: |-
Emojify returns a copy of s with all emoji codes replaced with actual emojis.
-
+
See http://www.emoji-cheat-sheet.com/
Examples:
- - '{{ "I :heart: Hugo" | emojify }}'