Document Go template's multiline support

Closes #764
This commit is contained in:
Joe Mooring
2021-05-03 08:06:02 -07:00
committed by Bjørn Erik Pedersen
parent 0c8f2dcb13
commit de7d96fa28
+16
View File
@@ -68,6 +68,22 @@ Accessing the Page Parameter `bar` defined in a piece of content's [front matter
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
```
#### A Single Statement Can be Split over Multiple Lines
```go-html-template
{{ if or
(isset .Params "alt")
(isset .Params "caption")
}}
```
#### Raw String Literals Can Include Newlines
```go-html-template
{{ $msg := `Line one.
Line two.` }}
```
## Variables {#variables}
Each Go Template gets a data object. In Hugo, each template is passed