diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-06-21 09:41:24 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-06-21 09:41:24 +0200 |
commit | af0cb57aaf668278551454678eac60b17348b13c (patch) | |
tree | b0fbd866cfc5e605ff789de9d6d9b162094a217b /docs/content/en/functions/global/site.md | |
parent | d5542ed286746e89fb13a1f821d4955ace371773 (diff) | |
parent | 8b9803425e63e1b1801f8d5d676e96368d706722 (diff) | |
download | hugo-af0cb57aaf668278551454678eac60b17348b13c.tar.gz hugo-af0cb57aaf668278551454678eac60b17348b13c.zip |
Merge commit '8b9803425e63e1b1801f8d5d676e96368d706722'
Diffstat (limited to 'docs/content/en/functions/global/site.md')
-rw-r--r-- | docs/content/en/functions/global/site.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/content/en/functions/global/site.md b/docs/content/en/functions/global/site.md index a097e471b..a4879fee0 100644 --- a/docs/content/en/functions/global/site.md +++ b/docs/content/en/functions/global/site.md @@ -12,17 +12,19 @@ action: 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 -{{ .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 -{{ site.Params.foo }} +<!-- current context --> +{{ .Site.Params.foo }} +<!-- template context --> +{{ $.Site.Params.foo }} ``` {{% note %}} |