Back to Hugo

Title

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

0.161.11.1 KB
Original Source

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

go-html-template
{{ .Title }} → About us

When a page is not backed by a file, the value returned by the Title method depends on the page kind.

Page kindPage title when the page is not backed by a file
homesite title
sectionsection name (capitalized and pluralized)
taxonomytaxonomy name (capitalized and pluralized)
termterm name (capitalized and pluralized)

You can disable automatic capitalization and pluralization in your project configuration:

{{< code-toggle file=hugo >}} capitalizeListTitles = false pluralizeListTitles = false {{< /code-toggle >}}

You can change the capitalization style in your project configuration to one of ap, chicago, go, firstupper, or none. For example:

{{< code-toggle file=hugo >}} titleCaseStyle = "firstupper" {{< /code-toggle >}}

See details.