I am migrating my website from Hugo 0.120.4 to 0.139.4. Suddenly some of my menu items don’t appear anymore.
I defined the menu in site configuration like this:
[menus]
[[menus.main]]
pageRef = '/about'
weight = 30
[[menus.main]]
pageRef = '/posts'
weight = 20
[[menus.main]]
pageRef = '/phluide'
name = 'pHluide (pro)'
weight = 10
And I’m using the Ananke theme with the site navigation template:
{{ if .Site.Menus.main }}
<ul class="{{ cond (eq $.Site.Language.LanguageDirection "rtl") "pr0 ml3" "pl0 mr3" }}">
{{ range .Site.Menus.main }}
<li class="list f5 f4-ns fw4 dib {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3" "pr3" }}">
<a class="hover-white no-underline white-90" href="{{ .URL }}" title="{{ i18n "pageTitle" . }}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
This gives the following output:
<ul class="pl0 mr3">
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/phluide/" title="pHluide (pro) page">
pHluide (pro)
</a>
</li>
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/about/" title=" page">
</a>
</li>
</ul>
So:
about
’sname
is blank;posts
is not rendered at all;phluide
is rendered as expected.
Name | Hugo specifies names should fall back to titles. And everything was fine before migrating. Still is, actually, on my production site.
Front-matter of /about/index.md
:
---
title: 'À propos'
description: 'Vous êtes ici.'
date: 2023-11-20T16:37:58+01:00
draft: false
---
Front-matter of /posts/_index.md
:
---
title: Articles
description: Professionnels ou non.
---
Front-matter of /phluide/_index.md
:
---
title: 'pHluide'
description: 'Page professionnelle'
type: page
layout: single
date: 2023-11-20T16:37:58+01:00
draft: false
toc: true
---