Debian Codegraph @

docs/content/en/methods/page/Title.md

raw
1 ---
2 title: Title
3 description: Returns the title of the given page.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 returnType: string
9 signatures: [PAGE.Title]
10 ---
11
12 With pages backed by a file, the `Title` method returns the `title` field as defined in front matter:
13
14 {{< code-toggle file=content/about.md fm=true >}}
15 title = 'About us'
16 {{< /code-toggle >}}
17
18 ```go-html-template
19 {{ .Title }} → About us
20 ```
21
22 When a page is not backed by a file, the value returned by the `Title` method depends on the page [kind](g).
23
24 Page kind|Page title when the page is not backed by a file
25 :--|:--
26 home|site title
27 section|section name (capitalized and pluralized)
28 taxonomy|taxonomy name (capitalized)
29 term|term name (capitalized)
30
31 You can disable automatic capitalization and pluralization in your project configuration:
32
33 {{< code-toggle file=hugo >}}
34 capitalizeListTitles = false
35 pluralizeListTitles = false
36 {{< /code-toggle >}}
37
38 You can change the capitalization style in your project configuration to one of `ap`, `chicago`, `go`, `firstupper`, or `none`. For example:
39
40 {{< code-toggle file=hugo >}}
41 titleCaseStyle = "firstupper"
42 {{< /code-toggle >}}
43
44 See [details][].
45
46 [details]: /configuration/all/#title-case-style