Syntax
Learn about the syntax of templates.
Templates syntax
-
Accessing keys
You can access the keys in the JSON object by using the
{{ .key }}
syntax. The key is case sensitive and should be used as it is in the JSON object. -
Looping through keys
You can loop through by using the
{{ range .key }}
syntax. Therange
keyword is used to loop through the keys in the JSON object. The.
is used to access the current key in the loop. -
If statements
You can use if statements using
if
andelse
keywords. -
Functions
You can use functions in the templating syntax to manipulate the data in runtime.