.Name resolves to unexpected values

In my content directory, I have ~10 folders with ~2 to 3 .md files inside each of them. One of these folders is called “person” (others are called “material” or “sponsor”, you get the idea).

Furthermore, I am using a partial (called header.html) which I include in my _default/baseof.html that generates a navigation from all the folders and files inside the content directory. To enable this, I have configured sectionPagesMenu: 'main' in my hugo.yaml.
This partial therefore uses {{ with .Site.Menus.main }} to access the menu entries, and resolves {{ .Name }} to populate its navigation entries.

For some reason, .Name seems to resolve to capitalized plural versions of all my folders’ names, meaning “material” becomes “Materials”, “sponsor” becomes “Sponsor” and so on and so forth.
Interestingly, “people” does not turn into “Peoples”, but “Persons”.

I am trying to wrap my head around the reason why this is happening. Perhaps anyone here has an idea?

(Side note: The folder “day” is completely ignored by Hugo, no pages and no menu entries are generated for it, but that’s another story that I have no answer to)

hugo new content person/_index.md
hugo new content material/_index.md
hugo new content sponsor/_index.md

Then set the section title in each of the markdown files.

In the absence of an _index.md file in the top level directories, Hugo has to guess at the title based on the directory name.

Thanks a lot, this resolved my issue!

I do wonder though, based on which logic does Hugo “guess at the title based on the directory name”?


As you described… capitalized plural.

You can disable the list title pluralization with:

See Is there a reason why list titles are pluralised by default? - #4 by jmooring