| 1 |
--- |
| 2 |
title: strings.Title |
| 3 |
description: Returns the given string, converting it to title case. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
aliases: [title] |
| 9 |
returnType: string |
| 10 |
signatures: [strings.Title STRING] |
| 11 |
aliases: [/functions/title] |
| 12 |
--- |
| 13 |
|
| 14 |
```go-html-template |
| 15 |
{{ title "table of contents (TOC)" }} → Table of Contents (TOC) |
| 16 |
``` |
| 17 |
|
| 18 |
By default, Hugo follows the capitalization rules published in the [Associated Press Stylebook][]. Change your [project configuration][] if you would prefer to: |
| 19 |
|
| 20 |
- Follow the capitalization rules published in the [Chicago Manual of Style][] |
| 21 |
- Capitalize the first letter of every word |
| 22 |
- Capitalize the first letter of the first word |
| 23 |
- Disable the effects of the `title` function |
| 24 |
|
| 25 |
The last option is useful if your theme uses the `title` function, and you would prefer to manually capitalize strings as needed. |
| 26 |
|
| 27 |
[Associated Press Stylebook]: https://www.apstylebook.com/ |
| 28 |
[Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html |
| 29 |
[project configuration]: /configuration/all/#title-case-style |