diff --git a/content/en/functions/title.md b/content/en/functions/title.md index 2e7d891ea..c7ed68bb4 100644 --- a/content/en/functions/title.md +++ b/content/en/functions/title.md @@ -1,29 +1,23 @@ --- title: title -description: Converts all characters in the provided string to title case. +description: Converts the provided string to title case. categories: [functions] menu: docs: parent: functions keywords: [strings] signature: - - "title INPUT" - - "strings.Title INPUT" + - "title STRING" + - "strings.Title STRING" relatedfuncs: [] --- ```go-html-template -{{ title "BatMan"}}` → "Batman" +{{ title "table of contents (TOC)" }} → "Table of Contents (TOC)" ``` -Can be combined in pipes. In the following snippet, the link text is cleaned up using `humanize` to remove dashes and `title` to convert the value of `$name` to Initial Caps. +By default, Hugo adheres to the capitalization rules in the [Associated Press (AP) Stylebook]. Change your [site configuration] if you would prefer to follow the [Chicago Manual of Style], or to use Go's convention of captilalizing every word. -```go-html-template -{{ range $name, $items := .Site.Taxonomies.categories }} -
  • {{ $name | humanize | title }} ({{ len $items }})
  • -{{ end }} -``` - -## Configure Title Case - -The default is AP Stylebook, but you can [configure it](/getting-started/configuration/#configure-title-case). +[Associated Press (AP) Stylebook]: https://www.apstylebook.com/ +[Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html +[site configuration]: /getting-started/configuration/#configure-title-case diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index b9be01bbf..0eabd4591 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -575,7 +575,13 @@ status = 404 ## Configure Title Case -Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter). +Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. + +By default, Hugo adheres to the capitalization rules in the [Associated Press (AP) Stylebook]. Set `titleCaseStyle` to `chicago` if you would prefer to follow the [Chicago Manual of Style], or set if to `go` to use Go's convention of captilalizing every word. + +[Associated Press (AP) Stylebook]: https://www.apstylebook.com/ +[Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html +[site configuration]: /getting-started/configuration/#configure-title-case ## Configuration Environment Variables