site
Returns the Site object of the current site, accessible from any context.
- Syntax
- site
- Returns
- page.siteWrapper
Use the site function to return the Site object regardless of current context.
{{ site.Params.foo }}When the Site object is in context you can use the Site property:
<!-- current context -->
{{ .Site.Params.foo }}
<!-- template context -->
{{ $.Site.Params.foo }}To simplify your templates, use the global site function regardless of whether the Site object is in context.
Last updated:
September 11, 2026
:
content: Comply with function/method description guidance in style guide (76fa3fc9e)
Improve this page