mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Merge commit 'dec8cd4ada29218971743333f8ac662a9c06aad8'
This commit is contained in:
@@ -509,6 +509,20 @@ See documentation for [`with`], [`else`], and [`end`].
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
To test multiple conditions:
|
||||
|
||||
```go-html-template
|
||||
{{ $v1 := 0 }}
|
||||
{{ $v2 := 42 }}
|
||||
{{ with $v1 }}
|
||||
{{ . }}
|
||||
{{ else with $v2 }}
|
||||
{{ . }} → 42
|
||||
{{ else }}
|
||||
{{ print "v1 and v2 are falsy" }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
### Access site parameters
|
||||
|
||||
See documentation for the [`Params`](/methods/site/params/) method on a `Site` object.
|
||||
|
Reference in New Issue
Block a user