Merge commit 'dec8cd4ada29218971743333f8ac662a9c06aad8'

This commit is contained in:
Bjørn Erik Pedersen
2024-09-01 14:51:15 +02:00
43 changed files with 906 additions and 436 deletions

View File

@@ -36,6 +36,20 @@ Use with the [`else`] statement:
{{ end }}
```
Use `else with` to check multiple conditions:
```go-html-template
{{ $v1 := 0 }}
{{ $v2 := 42 }}
{{ with $v1 }}
{{ . }}
{{ else with $v2 }}
{{ . }} → 42
{{ else }}
{{ print "v1 and v2 are falsy" }}
{{ end }}
```
Initialize a variable, scoped to the current block:
```go-html-template