Back to Hugo

site

docs/content/en/functions/global/site.md

0.161.1450 B
Original Source

Use the site function to return the Site object regardless of current context.

go-html-template
{{ site.Params.foo }}

When the Site object is in context you can use the Site property:

go-html-template
<!-- current context -->
{{ .Site.Params.foo }}
<!-- template context -->
{{ $.Site.Params.foo }}

[!note] To simplify your templates, use the global site function regardless of whether the Site object is in context.