diff --git a/content/en/_common/methods/taxonomy/get-a-taxonomy-object.md b/content/en/_common/methods/taxonomy/get-a-taxonomy-object.md index a6c46b8b7..c90224338 100644 --- a/content/en/_common/methods/taxonomy/get-a-taxonomy-object.md +++ b/content/en/_common/methods/taxonomy/get-a-taxonomy-object.md @@ -32,7 +32,7 @@ To capture the "genres" `Taxonomy` object from within any template, use the [`Ta {{ $taxonomyObject := .Site.Taxonomies.genres }} ``` -To capture the "genres" `Taxonomy` object when rendering its page with a taxonomy template, use the [`Terms`] method on the page's [`Data`] object: +To capture the "genres" `Taxonomy` object when rendering its page with a _taxonomy_ template, use the [`Terms`] method on the page's [`Data`] object: ```go-html-template {file="layouts/taxonomy.html"} {{ $taxonomyObject := .Data.Terms }} diff --git a/content/en/about/features.md b/content/en/about/features.md index ff1a6b8eb..d9fd36f61 100644 --- a/content/en/about/features.md +++ b/content/en/about/features.md @@ -92,7 +92,7 @@ weight: 20 ## Performance [Caching] -: Reduce build time and cost by rendering a partial template once then cache the result, either globally or within a given context. For example, cache the result of an asset pipeline to prevent reprocessing on every rendered page. +: Reduce build time and cost by rendering a _partial_ template once then cache the result, either globally or within a given context. For example, cache the result of an asset pipeline to prevent reprocessing on every rendered page. [Segmentation] : Reduce build time and cost by partitioning your sites into segments. For example, render the home page and the "news section" every hour, and render the entire site once a week. diff --git a/content/en/configuration/related-content.md b/content/en/configuration/related-content.md index 7f2aa9831..421a1ea77 100644 --- a/content/en/configuration/related-content.md +++ b/content/en/configuration/related-content.md @@ -95,7 +95,7 @@ weight = 1 We've configured the `authors` index with a weight of `2` and the `genres` index with a weight of `1`. This means Hugo prioritizes shared `authors` as twice as significant as shared `genres`. -Then render a list of 5 related reviews with a partial template like this: +Then render a list of 5 related reviews with a _partial_ template like this: ```go-html-template {file="layouts/_partials/related.html" copy=true} {{ with site.RegularPages.Related . | first 5 }} diff --git a/content/en/content-management/content-adapters.md b/content/en/content-management/content-adapters.md index e22962531..a3ac17c0e 100644 --- a/content/en/content-management/content-adapters.md +++ b/content/en/content-management/content-adapters.md @@ -237,7 +237,7 @@ Create the content adapter. ### Step 4 -Create a page template to render each book review. +Create a _page_ template to render each book review. ```go-html-template {file="layouts/books/page.html" copy=true} {{ define "main" }} diff --git a/content/en/content-management/mathematics.md b/content/en/content-management/mathematics.md index dc47cbde4..0dbe4ef25 100644 --- a/content/en/content-management/mathematics.md +++ b/content/en/content-management/mathematics.md @@ -85,7 +85,7 @@ inline = [['@', '@']] ### Step 2 -Create a partial template to load MathJax or KaTeX. The example below loads MathJax, or you can use KaTeX as described in the [engines](#engines) section. +Create a _partial_ template to load MathJax or KaTeX. The example below loads MathJax, or you can use KaTeX as described in the [engines](#engines) section. ```go-html-template {file="layouts/_partials/math.html" copy=true} @@ -106,7 +106,7 @@ The delimiters above must match the delimiters in your site configuration. ### Step 3 -Conditionally call the partial template from the base template. +Conditionally call the _partial_ template from the base template. ```go-html-template {file="layouts/baseof.html"} @@ -118,7 +118,7 @@ Conditionally call the partial template from the base template. ``` -The example above loads the partial template if you have set the `math` parameter in front matter to `true`. If you have not set the `math` parameter in front matter, the conditional statement falls back to the `math` parameter in your site configuration. +The example above loads the _partial_ template if you have set the `math` parameter in front matter to `true`. If you have not set the `math` parameter in front matter, the conditional statement falls back to the `math` parameter in your site configuration. ### Step 4 @@ -179,7 +179,7 @@ MathJax and KaTeX are open-source JavaScript display engines. Both engines are f > >See the [inline delimiters](#inline-delimiters) section for details. -To use KaTeX instead of MathJax, replace the partial template from [Step 2] with this: +To use KaTeX instead of MathJax, replace the _partial_ template from [Step 2] with this: ```go-html-template {file="layouts/_partials/math.html" copy=true} }} [security] @@ -69,7 +69,7 @@ In the example above, the inline shortcode is executed twice: once upon definiti

Today is Thursday, January 30, 2025

``` -Inline shortcodes process their inner content within the same context as regular shortcode templates, allowing you to use any available [shortcode method]. +Inline shortcodes process their inner content within the same context as regular _shortcode_ templates, allowing you to use any available [shortcode method]. > [!note] > You cannot [nest](#nesting) inline shortcodes. @@ -179,7 +179,7 @@ Hugo processes the shortcode before the page content is rendered by the Markdown With standard notation, Hugo processes the shortcode separately, merging the output into the page content after Markdown rendering. This means, for instance, that Markdown headings inside a standard-notation shortcode will be excluded when invoking the `TableOfContents` method on the `Page` object. -By way of example, with this shortcode template: +By way of example, with this _shortcode_ template: ```go-html-template {file="layouts/_shortcodes/foo.html"} {{ .Inner }} diff --git a/content/en/content-management/taxonomies.md b/content/en/content-management/taxonomies.md index 6caf70b0c..e52f9fe35 100644 --- a/content/en/content-management/taxonomies.md +++ b/content/en/content-management/taxonomies.md @@ -139,7 +139,7 @@ title = "John Smith" affiliation = "University of Chicago" {{< /code-toggle >}} -Then create a taxonomy template specific to the "authors" taxonomy: +Then create a _taxonomy_ template specific to the "authors" taxonomy: ```go-html-template {file="layouts/authors/taxonomy.html"} {{ define "main" }} @@ -159,7 +159,7 @@ Then create a taxonomy template specific to the "authors" taxonomy: In the example above we list each author including their affiliation and portrait. -Or create a term template specific to the "authors" taxonomy: +Or create a _term_ template specific to the "authors" taxonomy: ```go-html-template {file="layouts/authors/term.html"} {{ define "main" }} diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index c72ddd03f..af847ad64 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -70,6 +70,22 @@ Link to the [glossary] as needed and use terms consistently. Pay particular atte - "Markdown" (capitalized) - "open-source" (hyphenated adjective) +### Template types + +When you refer to a template type, italicize it: + +```text +When creating a _taxonomy_ template, do this... +``` + +However, if the template type is also a link, do not italicize it to avoid distracting formatting: + +```text +When creating a [taxonomy] template, do this... +``` + +Do not italicize the template type in a title, heading, or front matter description. + ### Titles and headings - Use sentence-style capitalization. diff --git a/content/en/functions/css/TailwindCSS.md b/content/en/functions/css/TailwindCSS.md index 9d40ad0aa..f7368299f 100644 --- a/content/en/functions/css/TailwindCSS.md +++ b/content/en/functions/css/TailwindCSS.md @@ -75,7 +75,7 @@ Tailwind CSS respects `.gitignore` files. This means that if `hugo_stats.json` i ### Step 4 -Create a partial template to process the CSS with the Tailwind CSS CLI: +Create a _partial_ template to process the CSS with the Tailwind CSS CLI: ```go-html-template {file="layouts/_partials/css.html" copy=true} {{ with resources.Get "css/main.css" }} @@ -94,7 +94,7 @@ Create a partial template to process the CSS with the Tailwind CSS CLI: ### Step 5 -Call the partial template from your base template, deferring template execution until after all sites and output formats have been rendered: +Call the _partial_ template from your base template, deferring template execution until after all sites and output formats have been rendered: ```go-html-template {file="layouts/baseof.html" copy=true} diff --git a/content/en/functions/global/page.md b/content/en/functions/global/page.md index 40f6aba8f..a7672d947 100644 --- a/content/en/functions/global/page.md +++ b/content/en/functions/global/page.md @@ -53,9 +53,9 @@ content/ └── _index.md <-- title is "My Home Page" ``` -And this code in the home template: +And this code in the _home_ template: -```go-html-template +```go-html-template {file="layouts/home.html"} {{ range site.Sections }} {{ range .Pages }} {{ page.Title }} @@ -71,7 +71,7 @@ My Home Page My Home Page ``` -In the example above, the global `page` function accesses the `Page` object passed into the home template; it does not access the `Page` object of the iterated pages. +In the example above, the global `page` function accesses the `Page` object passed into the _home_ template; it does not access the `Page` object of the iterated pages. ### Be aware of caching @@ -83,9 +83,9 @@ Do not use the global `page` function in: Hugo caches rendered shortcodes. If you use the global `page` function within a shortcode, and the page content is rendered in two or more templates, the cached shortcode may be incorrect. -Consider this section template: +Consider this _section_ template: -```go-html-template +```go-html-template {file="layouts/section.html"} {{ range .Pages }}

{{ .LinkTitle }}

{{ .Summary }} diff --git a/content/en/functions/go-template/define.md b/content/en/functions/go-template/define.md index 40d495bd9..b951ee3e1 100644 --- a/content/en/functions/go-template/define.md +++ b/content/en/functions/go-template/define.md @@ -43,18 +43,6 @@ Use with the [`template`] function: {{ end }} ``` -> [!warning] -> Only [template comments] are allowed outside of the `define` and `end` statements. Avoid placing any other text, including HTML comments, outside of these boundaries. Doing so will cause rendering issues, potentially resulting in a blank page. See the example below. - -```go-html-template {file="layouts/do-not-do-this.html"} -
This div element broke your template.
-{{ define "main" }} -

{{ .Title }}

- {{ .Content }} -{{ end }} - -``` - {{% include "/_common/functions/go-template/text-template.md" %}} [`block`]: /functions/go-template/block/ diff --git a/content/en/functions/go-template/range.md b/content/en/functions/go-template/range.md index 50f714140..3c50068f1 100644 --- a/content/en/functions/go-template/range.md +++ b/content/en/functions/go-template/range.md @@ -38,7 +38,9 @@ Within a range block: ## Understanding context -At the top of a page template, the [context](g) (the dot) is a `Page` object. Within the `range` block, the context is bound to each successive element. +See the [context] section in the introduction to templating. + +For example, at the top of a _page_ template, the [context](g) (the dot) is a `Page` object. Within the `range` block, the context is bound to each successive element. With this contrived example: @@ -217,3 +219,4 @@ Ranging over a non-positive integer executes the block zero times. [`break`]: /functions/go-template/break/ [`continue`]: /functions/go-template/continue/ [`else`]: /functions/go-template/else/ +[context]: /templates/introduction/#context diff --git a/content/en/functions/go-template/return.md b/content/en/functions/go-template/return.md index 911c0925c..e96908565 100644 --- a/content/en/functions/go-template/return.md +++ b/content/en/functions/go-template/return.md @@ -10,7 +10,7 @@ params: signatures: ['return [VALUE]'] --- -The `return` statement is a non-standard extension to Go's [text/template package]. Used within partial templates, the `return` statement terminates template execution and returns the given value, if any. +The `return` statement is a non-standard extension to Go's [text/template package]. Used within _partial_ templates, the `return` statement terminates template execution and returns the given value, if any. The returned value may be of any data type including, but not limited to, [`bool`](g), [`float`](g), [`int`](g), [`map`](g), [`resource`](g), [`slice`](g), or [`string`](g). @@ -21,7 +21,7 @@ A `return` statement without a value returns an empty string of type `template.H ## Example -By way of example, let's create a partial template that _renders_ HTML, describing whether the given number is odd or even: +By way of example, let's create a _partial_ template that _renders_ HTML, describing whether the given number is odd or even: ```go-html-template {file="layouts/_partials/odd-or-even.html"} {{ if math.ModBool . 2 }} diff --git a/content/en/functions/go-template/template.md b/content/en/functions/go-template/template.md index 903f1490a..3a631f695 100644 --- a/content/en/functions/go-template/template.md +++ b/content/en/functions/go-template/template.md @@ -20,7 +20,7 @@ Use the `template` function to execute a defined template: {{ end }} ``` -The example above can be rewritten using an inline partial template: +The example above can be rewritten using an inline _partial_ template: ```go-html-template {{ partial "inline/foo.html" (dict "answer" 42) }} diff --git a/content/en/functions/go-template/with.md b/content/en/functions/go-template/with.md index c25ce3fba..7354f1608 100644 --- a/content/en/functions/go-template/with.md +++ b/content/en/functions/go-template/with.md @@ -57,7 +57,9 @@ Initialize a variable, scoped to the current block: ## Understanding context -At the top of a page template, the [context](g) (the dot) is a `Page` object. Inside of the `with` block, the context is bound to the value passed to the `with` statement. +See the [context] section in the introduction to templating. + +For example, at the top of a _page_ template, the [context](g) (the dot) is a `Page` object. Inside of the `with` block, the context is bound to the value passed to the `with` statement. With this contrived example: @@ -90,3 +92,4 @@ This template will render the page title as desired: {{% include "/_common/functions/go-template/text-template.md" %}} [`else`]: /functions/go-template/else/ +[context]: /templates/introduction/#context diff --git a/content/en/functions/hugo/Store.md b/content/en/functions/hugo/Store.md index 08c684146..c0d5c5933 100644 --- a/content/en/functions/hugo/Store.md +++ b/content/en/functions/hugo/Store.md @@ -100,7 +100,7 @@ Removes the given key. ## Determinate values -The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content. +The `Store` method is often used to set scratch pad values within a _shortcode_ template, a _partial_ template called by a _shortcode_ template, or by a _render hook_ template. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content. If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop](g) variable: diff --git a/content/en/functions/js/Batch.md b/content/en/functions/js/Batch.md index a2c8bb893..aa57dd71d 100644 --- a/content/en/functions/js/Batch.md +++ b/content/en/functions/js/Batch.md @@ -158,7 +158,7 @@ import * as params from "@params"; import * as config from "@params/config"; ``` -Setting the `Config` for a batch can be done from any template (including shortcode templates), but will only be set once (the first will win): +Setting the `Config` for a batch can be done from any template (including _shortcode_ templates), but will only be set once (the first will win): ```go-html-template {{ with js.Batch "js/mybatch" }} diff --git a/content/en/functions/partials/Include.md b/content/en/functions/partials/Include.md index 0474bf77f..8551366da 100644 --- a/content/en/functions/partials/Include.md +++ b/content/en/functions/partials/Include.md @@ -1,6 +1,6 @@ --- title: partials.Include -description: Executes the given partial template, optionally passing context. If the partial template contains a return statement, returns the given value, else returns the rendered output. +description: Executes the given , optionally passing context. If the contains a return statement, returns the given value, else returns the rendered output. categories: [] keywords: [] params: @@ -15,7 +15,7 @@ Without a [`return`] statement, the `partial` function returns a string of type [`return`]: /functions/go-template/return/ -In this example we have three partial templates: +In this example we have three _partial_ templates: ```text layouts/ @@ -56,7 +56,7 @@ You can pass anything in context: a page, a page collection, a scalar value, a s {{ partial "render-student-info.html" $ctx }} ``` -Then, within the partial template: +Then, within the _partial_ template: ```go-html-template

{{ .name }} is majoring in {{ .major }}.

@@ -64,7 +64,7 @@ Then, within the partial template:

See details.

``` -To return a value from a partial template, it must contain only one `return` statement, placed at the end of the template: +To return a value from a _partial_ template, it must contain only one `return` statement, placed at the end of the template: ```go-html-template {{ $result := "" }} diff --git a/content/en/functions/partials/IncludeCached.md b/content/en/functions/partials/IncludeCached.md index 9bf1d5384..4d1167803 100644 --- a/content/en/functions/partials/IncludeCached.md +++ b/content/en/functions/partials/IncludeCached.md @@ -1,6 +1,6 @@ --- title: partials.IncludeCached -description: Executes the given template and caches the result, optionally passing context. If the partial template contains a return statement, returns the given value, else returns the rendered output. +description: Executes the given template and caches the result, optionally passing context. If the contains a return statement, returns the given value, else returns the rendered output. categories: [] keywords: [] params: @@ -38,9 +38,9 @@ Pass additional arguments, of any data type, as needed to create unique variants {{ partialCached "footer.html" . .Params.country .Params.province }} ``` -The variant arguments are not available to the underlying partial template; they are only used to create unique cache keys. +The variant arguments are not available to the underlying _partial_ template; they are only used to create unique cache keys. -To return a value from a partial template, it must contain only one `return` statement, placed at the end of the template: +To return a value from a _partial_ template, it must contain only one `return` statement, placed at the end of the template: ```go-html-template {{ $result := "" }} diff --git a/content/en/functions/templates/Current.md b/content/en/functions/templates/Current.md index d2c2c9609..b82818c47 100644 --- a/content/en/functions/templates/Current.md +++ b/content/en/functions/templates/Current.md @@ -64,7 +64,7 @@ To visually mark where a template begins and ends execution: ### Call stack -To display the chain of templates that led to the current one, create a partial template that iterates through its ancestors: +To display the chain of templates that led to the current one, create a _partial_ template that iterates through its ancestors: ```go-html-template {file="layouts/_partials/template-call-stack.html" copy=true} {{ with templates.Current }} @@ -113,7 +113,7 @@ To reverse the order of the entries, chain the `Reverse` method to the `Ancestor ### VS Code -To render links that, when clicked, will open the template in Microsoft Visual Studio Code, create a partial template with anchor elements that use the `vscode` URI scheme: +To render links that, when clicked, will open the template in Microsoft Visual Studio Code, create a _partial_ template with anchor elements that use the `vscode` URI scheme: ```go-html-template {file="layouts/_partials/template-open-in-vs-code.html" copy=true} {{ with templates.Current.Parent }} diff --git a/content/en/functions/templates/Defer.md b/content/en/functions/templates/Defer.md index 16c32724e..fa666c731 100644 --- a/content/en/functions/templates/Defer.md +++ b/content/en/functions/templates/Defer.md @@ -14,7 +14,7 @@ aliases: [/functions/templates.defer] {{< new-in 0.128.0 />}} > [!note] -> This feature should only be used in the main page template, typically `layouts/baseof.html`. Using it in shortcodes, partials, or render hook templates may lead to unpredictable results. For further details, please refer to [this issue]. +> This feature should only be used in the main template, typically `layouts/baseof.html`. Using it in shortcodes, partials, or _render hook_ templates may lead to unpredictable results. For further details, please refer to [this issue]. [this issue]: https://github.com/gohugoio/hugo/issues/13492#issuecomment-2734700391 diff --git a/content/en/methods/page/Data.md b/content/en/methods/page/Data.md index bb88dbde6..387422901 100644 --- a/content/en/methods/page/Data.md +++ b/content/en/methods/page/Data.md @@ -38,7 +38,7 @@ content/ ## In a taxonomy template -Use these methods on the `Data` object within a taxonomy template. +Use these methods on the `Data` object within a _taxonomy_ template. Singular : (`string`) Returns the singular name of the taxonomy. @@ -68,7 +68,7 @@ Learn more about [taxonomy templates]. ## In a term template -Use these methods on the `Data` object within a term template. +Use these methods on the `Data` object within a _term_ template. Singular : (`string`) Returns the singular name of the taxonomy. diff --git a/content/en/methods/page/Page.md b/content/en/methods/page/Page.md index 01abb3103..b7bdf3558 100644 --- a/content/en/methods/page/Page.md +++ b/content/en/methods/page/Page.md @@ -9,25 +9,25 @@ params: signatures: [PAGE.Page] --- -This is a convenience method, useful within partial templates that are called from both [shortcodes](g) and page templates. +This is a convenience method, useful within _partial_ templates that are called from both _shortcode_ and other template types. ```go-html-template {file="layouts/_shortcodes/foo.html"} {{ partial "my-partial.html" . }} ``` -When the shortcode calls the partial, it passes the current [context](g) (the dot). The context includes identifiers such as `Page`, `Params`, `Inner`, and `Name`. +When the _shortcode_ template calls the _partial_ template, it passes the current [context](g) (the dot). The context includes identifiers such as `Page`, `Params`, `Inner`, and `Name`. ```go-html-template {file="layouts/page.html"} {{ partial "my-partial.html" . }} ``` -When the page template calls the partial, it also passes the current context (the dot). But in this case, the dot _is_ the `Page` object. +When the _page_ template calls the _partial_ template, it also passes the current context (the dot). But in this case, the dot _is_ the `Page` object. ```go-html-template {file="layouts/_partials/my-partial.html"} The page title is: {{ .Page.Title }} ``` -To handle both scenarios, the partial template must be able to access the `Page` object with `Page.Page`. +To handle both scenarios, the _partial_ template must be able to access the `Page` object with `Page.Page`. > [!note] > And yes, that means you can do `.Page.Page.Page.Page.Title` too. diff --git a/content/en/methods/page/Paginate.md b/content/en/methods/page/Paginate.md index 7792980e6..337811240 100644 --- a/content/en/methods/page/Paginate.md +++ b/content/en/methods/page/Paginate.md @@ -18,7 +18,7 @@ By default, the number of elements on each pager is determined by your [site con > > The `Paginate` method is more flexible. -You can invoke pagination on the [home template], [section templates], [taxonomy templates], and [term templates]. +You can invoke pagination in [home], [section], [taxonomy], and [term] templates. ```go-html-template {file="layouts/section.html"} {{ $pages := where .Site.RegularPages "Section" "articles" }} @@ -40,8 +40,8 @@ In the example above, we: > [!note] > Please note that the results of pagination are cached. Once you have invoked either the `Paginator` or `Paginate` method, the paginated collection is immutable. Additional invocations of these methods will have no effect. -[home template]: /templates/types/#home -[section templates]: /templates/types/#section +[home]: /templates/types/#home +[section]: /templates/types/#section [site configuration]: /configuration/pagination/ -[taxonomy templates]: /templates/types/#taxonomy -[term templates]: /templates/types/#term +[taxonomy]: /templates/types/#taxonomy +[term]: /templates/types/#term diff --git a/content/en/methods/page/Paginator.md b/content/en/methods/page/Paginator.md index 1518ac95d..02b5d5719 100644 --- a/content/en/methods/page/Paginator.md +++ b/content/en/methods/page/Paginator.md @@ -13,7 +13,7 @@ Pagination is the process of splitting a list page into two or more pagers, wher The number of elements on each pager is determined by your [site configuration]. The default is `10`. -You can invoke pagination on the [home template], [section templates], [taxonomy templates], and [term templates]. Each of these receives a collection of regular pages in [context](g). When you invoke the `Paginator` method, it paginates the page collection received in context. +You can invoke pagination in [home], [section], [taxonomy], and [term] templates. Each of these receives a collection of regular pages in [context](g). When you invoke the `Paginator` method, it paginates the page collection received in context. ```go-html-template {file="layouts/section.html"} {{ range .Paginator.Pages }} @@ -32,9 +32,9 @@ In the example above, the embedded pagination template creates navigation links > [!note] > Please note that the results of pagination are cached. Once you have invoked either the `Paginator` or `Paginate` method, the paginated collection is immutable. Additional invocations of these methods will have no effect. -[home template]: /templates/types/#home -[section templates]: /templates/types/#section +[home]: /templates/types/#home +[section]: /templates/types/#section [site configuration]: /configuration/pagination/ -[taxonomy templates]: /templates/types/#taxonomy -[term templates]: /templates/types/#term +[taxonomy]: /templates/types/#taxonomy +[term]: /templates/types/#term [`Paginate`]: /methods/page/paginate/ diff --git a/content/en/methods/page/RenderShortcodes.md b/content/en/methods/page/RenderShortcodes.md index 81a78b04b..e440302dc 100644 --- a/content/en/methods/page/RenderShortcodes.md +++ b/content/en/methods/page/RenderShortcodes.md @@ -9,7 +9,7 @@ params: signatures: [PAGE.RenderShortcodes] --- -Use this method in shortcode templates to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents. +Use this method in _shortcode_ templates to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents. For example: diff --git a/content/en/methods/page/Store.md b/content/en/methods/page/Store.md index 0b1049b0a..c5ad6b316 100644 --- a/content/en/methods/page/Store.md +++ b/content/en/methods/page/Store.md @@ -18,7 +18,7 @@ Use the `Store` method on a `Page` object to create a [scratch pad](g) to store ## Determinate values -The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content. +The `Store` method is often used to set scratch pad values within a _shortcode_ template, a _partial_ template called by a _shortcode_ template, or by a _render hook_ template. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content. If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop](g) variable: diff --git a/content/en/methods/shortcode/IsNamedParams.md b/content/en/methods/shortcode/IsNamedParams.md index c95398313..0574128ec 100644 --- a/content/en/methods/shortcode/IsNamedParams.md +++ b/content/en/methods/shortcode/IsNamedParams.md @@ -11,7 +11,7 @@ params: To support both positional and named arguments when calling a shortcode, use the `IsNamedParams` method to determine how the shortcode was called. -With this shortcode template: +With this _shortcode_ template: ```go-html-template {file="layouts/_shortcodes/myshortcode.html"} {{ if .IsNamedParams }} diff --git a/content/en/methods/shortcode/Ordinal.md b/content/en/methods/shortcode/Ordinal.md index 4c32705c1..b16758952 100644 --- a/content/en/methods/shortcode/Ordinal.md +++ b/content/en/methods/shortcode/Ordinal.md @@ -47,6 +47,6 @@ Hugo renders the page to: ``` > [!note] -> In the shortcode template above, the [`with`] statement is used to create conditional blocks. Remember that the `with` statement binds context (the dot) to its expression. Inside of a `with` block, preface shortcode method calls with a `$` to access the top-level context passed into the template. +> In the _shortcode_ template above, the [`with`] statement is used to create conditional blocks. Remember that the `with` statement binds context (the dot) to its expression. Inside of a `with` block, preface shortcode method calls with a `$` to access the top-level context passed into the template. [`with`]: /functions/go-template/with/ diff --git a/content/en/methods/site/GetPage.md b/content/en/methods/site/GetPage.md index 2a3bd7d59..34f531720 100644 --- a/content/en/methods/site/GetPage.md +++ b/content/en/methods/site/GetPage.md @@ -34,9 +34,9 @@ content/ └── _index.md ``` -This home template: +This _home_ template: -```go-html-template +```go-html-template {file="layouts/home.html"} {{ with .Site.GetPage "/works/paintings" }}