Skip to content

Commit

Permalink
Document Go template's multiline support
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored and bep committed May 3, 2021
1 parent 0c8f2dc commit de7d96f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions content/en/templates/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de7d96f

Please sign in to comment.