How to use page title in homepage context

It seems that Hugo uses the site title instead of the page title for home pages. I couldn’t find documentation about this. Is this intended behavior? Which shortcode can I use to get the page title even in homepage context?

See https://github.com/thomasheller/crab/issues/10 for an example.

Hi @tmh. Do you have a Title defined in front matter for your homepage?

For example, in content/_index.md do you have a title param defined?

Yes, the title is defined as title = "Home" in content/home.md: https://raw.githubusercontent.com/thomasheller/crab/2ba7640e8a223fce61f805b7c537b44ea73307c7/exampleSite/content/home.md

Hmm. What Hugo version are you using?

Hugo Static Site Generator v0.55.6-A5D4C82D2/extended linux/amd64 BuildDate: 2019-05-18T08:08:34Z

Okay, Hugo version is fine. You can fix this by

(1) Renaming

content/home

To

content/_index.md

(2) Then update layouts/index.html to be:

{{ partial "header.html" . }}
{{ .Content }}
{{ partial "footer.html" . }}

1 Like

Using _index.md did the trick. Thanks for your support!