mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -73,7 +73,7 @@ In the examples above we are coding defensively using the [`with`] statement, re
|
||||
|
||||
## Understanding context
|
||||
|
||||
Inside of the `with` block, the [context] (the dot) is the section `Page` object, not the `Page` object passed into the template. If we were to use this syntax:
|
||||
Inside of the `with` block, the [context](g) (the dot) is the section `Page` object, not the `Page` object passed into the template. If we were to use this syntax:
|
||||
|
||||
```go-html-template
|
||||
{{ with .Site.GetPage "/auctions" }}
|
||||
@@ -97,6 +97,5 @@ Use the `$` to get the context passed into the template.
|
||||
Gaining a thorough understanding of context is critical for anyone writing template code.
|
||||
{{% /note %}}
|
||||
|
||||
[context]: /getting-started/glossary/#context
|
||||
[`with`]: /functions/go-template/with/
|
||||
[`else`]: /functions/go-template/else/
|
||||
|
Reference in New Issue
Block a user