Document the capitalizeListTitles site config option

This commit is contained in:
Joe Mooring
2024-02-23 09:32:23 -08:00
committed by GitHub
parent 2ed3b77321
commit 46dd28266d
3 changed files with 25 additions and 9 deletions
+9 -1
View File
@@ -232,6 +232,14 @@ See [Configure Build](#configure-build).
See [Configure File Caches](#configure-file-caches).
###### capitalizeListTitles
{{< new-in 0.123.3 >}}
(`bool`) Whether to capitalize automatic list titles. Applicable to section, taxonomy, and term pages. Default is `true`. You can change the capitalization style in your site configuration to one of `ap`, `chicago`, `go`, `firstupper`, or `none`. See [details].
[details]: /getting-started/configuration/#configure-title-case
###### cascade
Pass down down default configuration values (front matter) to pages in the content tree. The options in site config is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#cascade).
@@ -385,7 +393,7 @@ See [Content Management](/content-management/urls/#permalinks).
###### pluralizeListTitles
(`bool`) Pluralize titles in lists. Default is `true`.
(`bool`) Whether to pluralize automatic list titles. Applicable to section pages. Default is `true`.
###### publishDir
+9 -7
View File
@@ -20,19 +20,21 @@ title = 'About us'
{{ .Title }} → About us
```
With section pages not backed by a file, the `Title` method returns the section name, pluralized and converted to title case.
To disable [pluralization]:
With section, taxonomy, and term pages not backed by a file, the `Title` method returns the section name, capitalized and pluralized. You can disable these transformations by setting [`capitalizeListTitles`] and [`pluralizeListTitles`] in your site configuration. For example:
{{< code-toggle file=hugo >}}
capitalizeListTitles = false
pluralizeListTitles = false
{{< /code-toggle >}}
To change the [title case style], specify one of `ap`, `chicago`, `go`, `firstupper`, or `none`:
You can change the capitalization style in your site configuration to one of `ap`, `chicago`, `go`, `firstupper`, or `none`. For example:
{{< code-toggle file=hugo >}}
titleCaseStyle = "ap"
titleCaseStyle = "firstupper"
{{< /code-toggle >}}
[pluralization]: /functions/inflect/pluralize/
[title case style]: /getting-started/configuration/#configure-title-case
See [details].
[`capitalizeListTitles`]: /getting-started/configuration/#capitalizelisttitles
[`pluralizeListTitles`]: /getting-started/configuration/#pluralizelisttitles
[details]: /getting-started/configuration/#configure-title-case
+7 -1
View File
@@ -152,7 +152,13 @@ Using this same `layouts/_default/list.html` template and applying it to the `qu
{{< /code >}}
{{% note %}}
The default behavior of Hugo is to pluralize list titles; hence the inflection of the `quote` section to "Quotes" when called with the `.Title` [page variable](/methods/page/). You can change this via the `pluralizeListTitles` directive in your [site configuration](/getting-started/configuration/).
By default, Hugo capitalizes and pluralizes automatic list titles including section, taxonomy, and term pages. You can disable these transformations by setting [`capitalizeListTitles`] and [`pluralizeListTitles`] in your site configuration.
You can change the capitalization style in your site configuration to one of `ap`, `chicago`, `go`, `firstupper`, or `none`. See [details].
[`capitalizeListTitles`]: /getting-started/configuration/#capitalizelisttitles
[`pluralizeListTitles`]: /getting-started/configuration/#pluralizelisttitles
[details]: /getting-started/configuration/#configure-title-case
{{% /note %}}
## Example list templates