mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-14 09:58:50 -04:00
Partial: Update variable name in example
This commit is contained in:
parent
7d7b1f03c1
commit
7b207a404d
@ -96,14 +96,14 @@ In addition to outputting markup, partials can be used to return a value of any
|
|||||||
#### Example GetImage
|
#### Example GetImage
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{/* layouts/partials/GetImage.html */}}
|
{{/* layouts/partials/GetImage.html */}}
|
||||||
{{ $return := false }}
|
{{ $image := false }}
|
||||||
{{ with .Params.gallery }}
|
{{ with .Params.gallery }}
|
||||||
{{ $return = index . 0 }}
|
{{ $image = index . 0 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Params.image }}
|
{{ with .Params.image }}
|
||||||
{{ $return = . }}
|
{{ $image = . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ return $return }}
|
{{ return $image }}
|
||||||
```
|
```
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
|
Loading…
x
Reference in New Issue
Block a user