diff options
Diffstat (limited to 'docs/content/en/functions/global')
-rw-r--r-- | docs/content/en/functions/global/_index.md | 7 | ||||
-rw-r--r-- | docs/content/en/functions/global/page.md | 21 | ||||
-rw-r--r-- | docs/content/en/functions/global/site.md | 16 |
3 files changed, 17 insertions, 27 deletions
diff --git a/docs/content/en/functions/global/_index.md b/docs/content/en/functions/global/_index.md index 1e609b56e..3d935176c 100644 --- a/docs/content/en/functions/global/_index.md +++ b/docs/content/en/functions/global/_index.md @@ -1,11 +1,6 @@ --- title: Global functions linkTitle: global -description: Global template functions to access page and site data. +description: Use these global functions to access page and site data. categories: [] -menu: - docs: - parent: functions --- - -Use these global functions to access page and site data. diff --git a/docs/content/en/functions/global/page.md b/docs/content/en/functions/global/page.md index 1dc8be515..0d4b8070f 100644 --- a/docs/content/en/functions/global/page.md +++ b/docs/content/en/functions/global/page.md @@ -3,13 +3,11 @@ title: page description: Provides global access to a Page object. categories: [] keywords: [] -action: - aliases: [] - related: - - functions/global/site - returnType: - signatures: [page] -toc: true +params: + functions_and_methods: + aliases: [] + returnType: + signatures: [page] aliases: [/functions/page] --- @@ -27,13 +25,12 @@ When a `Page` object is not in context, you can use the global `page` function: {{ page.Params.foo }} ``` -{{% note %}} -Do not use the global `page` function in shortcodes, partials called by shortcodes, or cached partials. See [warnings](#warnings) below. -{{% /note %}} +> [!note] +> Do not use the global `page` function in shortcodes, partials called by shortcodes, or cached partials. See [warnings](#warnings) below. ## Explanation -Hugo almost always passes a `Page` as the data context into the top level template (e.g., `single.html`). The one exception is the multihost sitemap template. This means that you can access the current page with the `.` in the template. +Hugo almost always passes a `Page` as the data context into the top-level template (e.g., `single.html`). The one exception is the multihost sitemap template. This means that you can access the current page with the `.` in the template. But when you are deeply nested inside of a [content view](g), [partial](g), or [render hook](g), it is not always practical or possible to access the `Page` object. @@ -99,5 +96,5 @@ When you call the [`Summary`] method, Hugo renders the page content including sh If Hugo renders the section page before a content page, the cached rendered shortcode will be incorrect. You cannot control the rendering sequence due to concurrency. -[`Summary`]: /methods/page/summary/ [`partialCached`]: /functions/partials/includecached/ +[`Summary`]: /methods/page/summary/ diff --git a/docs/content/en/functions/global/site.md b/docs/content/en/functions/global/site.md index a4879fee0..be0c6730e 100644 --- a/docs/content/en/functions/global/site.md +++ b/docs/content/en/functions/global/site.md @@ -3,12 +3,11 @@ title: site description: Provides global access to the current Site object. categories: [] keywords: [] -action: - aliases: [] - related: - - functions/global/page - returnType: - signatures: [site] +params: + functions_and_methods: + aliases: [] + returnType: + signatures: [site] aliases: [/functions/site] --- @@ -27,6 +26,5 @@ When the `Site` object is in context you can use the `Site` property: {{ $.Site.Params.foo }} ``` -{{% note %}} -To simplify your templates, use the global `site` function regardless of whether the `Site` object is in context. -{{% /note %}} +> [!note] +> To simplify your templates, use the global `site` function regardless of whether the `Site` object is in context. |