Skip to content

Commit 072536e

Browse files
authored
content: Update template type documentation
1 parent 5bf1535 commit 072536e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+187
-156
lines changed

‎content/en/_common/methods/taxonomy/get-a-taxonomy-object.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To capture the "genres" `Taxonomy` object from within any template, use the [`Ta
3232
{{ $taxonomyObject := .Site.Taxonomies.genres }}
3333
```
3434

35-
To capture the "genres" `Taxonomy` object when rendering its page with a taxonomy template, use the [`Terms`] method on the page's [`Data`] object:
35+
To capture the "genres" `Taxonomy` object when rendering its page with a _taxonomy_ template, use the [`Terms`] method on the page's [`Data`] object:
3636

3737
```go-html-template {file="layouts/taxonomy.html"}
3838
{{ $taxonomyObject := .Data.Terms }}

‎content/en/about/features.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ weight: 20
9292
## Performance
9393

9494
[Caching]
95-
: 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.
95+
: 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.
9696

9797
[Segmentation]
9898
: 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.

‎content/en/configuration/related-content.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ weight = 1
9595

9696
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`.
9797

98-
Then render a list of 5 related reviews with a partial template like this:
98+
Then render a list of 5 related reviews with a _partial_ template like this:
9999

100100
```go-html-template {file="layouts/_partials/related.html" copy=true}
101101
{{ with site.RegularPages.Related . | first 5 }}

‎content/en/content-management/content-adapters.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Create the content adapter.
237237

238238
### Step 4
239239

240-
Create a page template to render each book review.
240+
Create a _page_ template to render each book review.
241241

242242
```go-html-template {file="layouts/books/page.html" copy=true}
243243
{{ define "main" }}

‎content/en/content-management/mathematics.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ inline = [['@', '@']]
8585

8686
### Step 2
8787

88-
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.
88+
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.
8989

9090
```go-html-template {file="layouts/_partials/math.html" copy=true}
9191
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
@@ -106,7 +106,7 @@ The delimiters above must match the delimiters in your site configuration.
106106

107107
### Step 3
108108

109-
Conditionally call the partial template from the base template.
109+
Conditionally call the _partial_ template from the base template.
110110

111111
```go-html-template {file="layouts/baseof.html"}
112112
<head>
@@ -118,7 +118,7 @@ Conditionally call the partial template from the base template.
118118
</head>
119119
```
120120

121-
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.
121+
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.
122122

123123
### Step 4
124124

@@ -179,7 +179,7 @@ MathJax and KaTeX are open-source JavaScript display engines. Both engines are f
179179
>
180180
>See the [inline delimiters](#inline-delimiters) section for details.
181181
182-
To use KaTeX instead of MathJax, replace the partial template from [Step 2] with this:
182+
To use KaTeX instead of MathJax, replace the _partial_ template from [Step 2] with this:
183183

184184
```go-html-template {file="layouts/_partials/math.html" copy=true}
185185
<link

‎content/en/content-management/multilingual.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ To create a list of links to translated content, use a template similar to the f
127127
{{ end }}
128128
```
129129

130-
The above can be put in a partial template then included in any template. It will not print anything if there are no translations for a given page.
130+
The above can be put in a _partial_ template then included in any template. It will not print anything if there are no translations for a given page.
131131

132132
The above also uses the [`i18n` function][i18func] described in the next section.
133133

‎content/en/content-management/sections.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ With the file structure from the [example above](#overview):
6363

6464
1. The list page for the articles section includes all articles, regardless of directory structure; none of the subdirectories are sections.
6565
1. The articles/2022 and articles/2023 directories do not have list pages; they are not sections.
66-
1. The list page for the products section, by default, includes product-1 and product-2, but not their descendant pages. To include descendant pages, use the `RegularPagesRecursive` method instead of the `Pages` method in the section template.
66+
1. The list page for the products section, by default, includes product-1 and product-2, but not their descendant pages. To include descendant pages, use the `RegularPagesRecursive` method instead of the `Pages` method in the _section_ template.
6767
1. All directories in the products section have list pages; each directory is a section.
6868

6969
## Template selection

‎content/en/content-management/shortcodes.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Hugo's embedded shortcodes are pre-defined templates within the application. Ref
2020

2121
## Custom
2222

23-
Create custom shortcodes to simplify and standardize content creation. For example, the following shortcode template generates an audio player using a [global resource](g):
23+
Create custom shortcodes to simplify and standardize content creation. For example, the following _shortcode_ template generates an audio player using a [global resource](g):
2424

2525
```go-html-template {file="layouts/_shortcodes/audio.html"}
2626
{{ with resources.Get (.Get "src") }}
@@ -38,11 +38,11 @@ Learn more about creating shortcodes in the [shortcode templates] section.
3838

3939
## Inline
4040

41-
An inline shortcode is a shortcode template defined within content.
41+
An inline shortcode is a _shortcode_ template defined within content.
4242

4343
Hugo's security model is based on the premise that template and configuration authors are trusted, but content authors are not. This model enables generation of HTML output safe against code injection.
4444

45-
To conform with this security model, creating shortcode templates within content is disabled by default. If you trust your content authors, you can enable this functionality in your site's configuration:
45+
To conform with this security model, creating _shortcode_ templates within content is disabled by default. If you trust your content authors, you can enable this functionality in your site's configuration:
4646

4747
{{< code-toggle file=hugo >}}
4848
[security]
@@ -69,7 +69,7 @@ In the example above, the inline shortcode is executed twice: once upon definiti
6969
<p>Today is Thursday, January 30, 2025</p>
7070
```
7171

72-
Inline shortcodes process their inner content within the same context as regular shortcode templates, allowing you to use any available [shortcode method].
72+
Inline shortcodes process their inner content within the same context as regular _shortcode_ templates, allowing you to use any available [shortcode method].
7373

7474
> [!note]
7575
> You cannot [nest](#nesting) inline shortcodes.
@@ -179,7 +179,7 @@ Hugo processes the shortcode before the page content is rendered by the Markdown
179179

180180
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.
181181

182-
By way of example, with this shortcode template:
182+
By way of example, with this _shortcode_ template:
183183

184184
```go-html-template {file="layouts/_shortcodes/foo.html"}
185185
{{ .Inner }}

‎content/en/content-management/taxonomies.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ title = "John Smith"
139139
affiliation = "University of Chicago"
140140
{{< /code-toggle >}}
141141

142-
Then create a taxonomy template specific to the "authors" taxonomy:
142+
Then create a _taxonomy_ template specific to the "authors" taxonomy:
143143

144144
```go-html-template {file="layouts/authors/taxonomy.html"}
145145
{{ define "main" }}
@@ -159,7 +159,7 @@ Then create a taxonomy template specific to the "authors" taxonomy:
159159

160160
In the example above we list each author including their affiliation and portrait.
161161

162-
Or create a term template specific to the "authors" taxonomy:
162+
Or create a _term_ template specific to the "authors" taxonomy:
163163

164164
```go-html-template {file="layouts/authors/term.html"}
165165
{{ define "main" }}

‎content/en/contribute/documentation.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ Link to the [glossary] as needed and use terms consistently. Pay particular atte
7070
- "Markdown" (capitalized)
7171
- "open-source" (hyphenated adjective)
7272

73+
### Template types
74+
75+
When you refer to a template type, italicize it:
76+
77+
```text
78+
When creating a _taxonomy_ template, do this...
79+
```
80+
81+
However, if the template type is also a link, do not italicize it to avoid distracting formatting:
82+
83+
```text
84+
When creating a [taxonomy] template, do this...
85+
```
86+
87+
Do not italicize the template type in a title, heading, or front matter description.
88+
7389
### Titles and headings
7490

7591
- Use sentence-style capitalization.

0 commit comments

Comments
 (0)