mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Document getenv template function
Add `getenv` to the template function documentation.
This commit is contained in:
parent
9a499b56c9
commit
42dcaabf4f
1 changed files with 13 additions and 0 deletions
|
@ -76,6 +76,19 @@ e.g.
|
|||
{{ end }}
|
||||
|
||||
|
||||
### getenv
|
||||
Returns the value of an environment variable.
|
||||
|
||||
Takes a string containing the name of the variable as input. Returns
|
||||
an empty string if the variable is not set, otherwise returns the
|
||||
value of the variable. Note that in Unix-like environments, the
|
||||
variable must also be exported in order to be seen by `hugo`.
|
||||
|
||||
e.g.
|
||||
|
||||
{{ getenv "HOME" }}
|
||||
|
||||
|
||||
### in
|
||||
Checks if an element is in an array (or slice) and returns a boolean. The elements supported are strings, integers and floats (only float64 will match as expected). In addition, it can also check if a substring exists in a string.
|
||||
|
||||
|
|
Loading…
Reference in a new issue