Capitalization of title tags changing menus

I’m having an issue with basic menus. I can’t tell if I’ve done something wrong or whether I’ve missed a section in the docs.

I put this on github in case that makes it easier to see what I’m working with:

I’ve cobbled together a basic site hierarchy with three sections:


I’m using the sectionPagesMenu configuration in config.toml and in each of these sections I’ve a basic with a title field and a single line of content. My nav.html partial ranges over and outputs a list with .URL and .Name. So far so good. My menu is Articles, Products, Tests and functions as it should, linking to /articles/, /products/ or /tests/.

Now I add a few directories in the products section:


Each of these have a couple pages of markdown and their own with title and summary tags. All still working fine until I change the title field in the of any of these “sub sections” to something that begins with an uppercase P (say, Product1) at which point the menu changes to Articles, Product1, Tests and the Product1 links to /products/product1/ instead of /products/. I change it back to lower case p and the links go back to being Articles, Products, Tests.

Doesn’t have to be a variation of the word product, if it’s lower case peanut the menu links to /products/ as intended but change it to Peanut and it’ll link to /products/product1/ with the text Peanut.

The same thing happens with the “Articles” and “Tests” directories.

I’ve only just picked up hugo so there’s a very good chance I’ve missed something in the docs and this is desired behavior but it doesn’t feel right to me.

Can someone shed some light on this for me please.

Do people generally use the sectionPagesMenu or is the recommended method to hard-code menus in the config.toml?

I started with hugo_extended 0.55.3 on Windows 64bit yesterday and upgraded to 0.55.4 a few minutes ago.


1 Like

This is surprising to me too. It seems it’s not just the capitalisation, but adding a prefix space or a dash as well.

Hard-coding the menu entries to config.toml is not the only alternative though. You can also define menu entries in page front-matter.

Yet another alternative is to define navigation according to the section structure directly:

{{ range site.Sections }}
  li class={{ if .IsAncestor $ }}active{{ end }}
    a href={{ .RelPermalink }} {{ .Title }}
      {{ range .Pages }}
        / ...
      {{ end }}
{{ end }}