mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 19:50:52 -04:00
Fix conflicting text for global site function
This commit is contained in:
parent
264fe788ee
commit
05494b7d2c
@ -12,17 +12,19 @@ action:
|
|||||||
aliases: [/functions/site]
|
aliases: [/functions/site]
|
||||||
---
|
---
|
||||||
|
|
||||||
At the top level of a template that receives the `Site` object in context, these are equivalent:
|
Use the `site` function to return the `Site` object regardless of current context.
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ .Site.Params.foo }}
|
|
||||||
{{ site.Params.foo }}
|
{{ site.Params.foo }}
|
||||||
```
|
```
|
||||||
|
|
||||||
When the `Site` object is not in context, use the global `site` function:
|
When the `Site` object is in context you can use the `Site` property:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ site.Params.foo }}
|
<!-- current context -->
|
||||||
|
{{ .Site.Params.foo }}
|
||||||
|
<!-- template context -->
|
||||||
|
{{ $.Site.Params.foo }}
|
||||||
```
|
```
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user