Document getenv template function

Add `getenv` to the template function documentation.
This commit is contained in:
mdhender 2015-04-04 20:07:25 -05:00 committed by bep
parent 9a499b56c9
commit 42dcaabf4f

View file

@ -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.