hugo/docs/content/en/functions/global/site.md
2024-06-21 09:41:24 +02:00

703 B

title description categories keywords action aliases
site Provides global access to the current Site object.
aliases related returnType signatures
functions/global/page
site
/functions/site

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 }}

{{% note %}} To simplify your templates, use the global site function regardless of whether the Site object is in context. {{% /note %}}