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