From 46dd28266d2541ba422692155f79d6cfa52e4ea3 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Fri, 23 Feb 2024 09:32:23 -0800 Subject: [PATCH] Document the capitalizeListTitles site config option --- content/en/getting-started/configuration.md | 10 +++++++++- content/en/methods/page/Title.md | 16 +++++++++------- content/en/templates/lists/index.md | 8 +++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 04b61685ca..a0556e1901 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -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 diff --git a/content/en/methods/page/Title.md b/content/en/methods/page/Title.md index ab005d03ca..5c2c98d6b2 100644 --- a/content/en/methods/page/Title.md +++ b/content/en/methods/page/Title.md @@ -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 diff --git a/content/en/templates/lists/index.md b/content/en/templates/lists/index.md index 06f11bf3d4..4af705bf8f 100644 --- a/content/en/templates/lists/index.md +++ b/content/en/templates/lists/index.md @@ -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