hugo env:
hugo v0.126.2+extended linux/amd64 BuildDate=2024-07-18T00:00:00+00:00 VendorInfo=Fedora:0.126.2-3.fc41
GOOS=“linux”
GOARCH=“amd64”
GOVERSION=“go1.23rc1”
github.com/sass/libsass=“3.6.5”
github.com/webmproject/libwebp=“v1.3.2”
Hello, I am using Hugo on a local server. I am using what I call the “built-in” theme created using:
hugo new theme
In the site’s hugo.toml I have:
[menus]
[[menus.main]]
name = 'Home'
pageRef = '/'
weight = 10
[[menus.main]]
name = 'Articles'
pageRef = '/passwords/articles/'
weight = 20
And this creates the 2 menu items correctly, ie the Articles URL is:
<li>
<a href="/passwords/articles/">Articles</a>
</li>
When I create an empty index.html in the site’s content folder, in order to create the content for a home page, this Articles link changes to:
<li>
<a>Articles</a>
</li>
IE the URL is removed from the Articles anchor tag and menu item.
I have tried having and not having _index.html in the /content/passwords/articles/ directory and this does not seem to make a difference.
I put in the site’s hugo.toml:
[menus]
[[menus.main]]
name = 'Home'
pageRef = '/'
weight = 10
and
menus = ‘main’
in _index.html in the /content/passwords/articles/ directory to create a menu item for this section instead, but this uses the title parameter for the menu item and this title is too long for the menu item. (I need the title parameter to be multi-word to define the title of the list page).
I also tried
menus = ‘main’
name = ‘Articles’
as per
and this did not display the menu item. IE it seemed like the name parameter did not work.
However, I tried the same above again today, and no menu item shows up, with or without using the name parameter. It seems I am getting different results trying the same thing.
I have spent hours trying to figure this out, and have had no luck.
I have searched the net and Hugo forum as well and have not found any relevant posts.
Any help on this would be much appreciated. Thank ahead of time.