hugo/docs/content/en/methods/page/Title.md
2024-06-21 09:41:24 +02:00

1.3 KiB

title description categories keywords action
Title Returns the title of the given page.
related returnType signatures
methods/page/LinkTitle
string
PAGE.Title

With pages backed by a file, the Title method returns the title field as defined in front matter:

{{< code-toggle file=content/about.md fm=true >}} title = 'About us' {{< /code-toggle >}}

{{ .Title }} → About us

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 >}}

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 = "firstupper" {{< /code-toggle >}}

See details.