Duplicate Menu Entry warning

Is there way to resolve this warning without changing the page titles. For example I have pages with title ‘Overview’ in multiple sections.

| WARN  "piroguetoolsuite.github.io/content/docs/pirogue/architecture/index.md:1:1": duplicate menu entry with identifier "Architecture" in menu "docs"
| WARN  "piroguetoolsuite.github.io/content/docs/pirogue/overview/index.md:1:1": duplicate menu entry with identifier "Overview" in menu "docs"
| WARN  "piroguetoolsuite.github.io/content/docs/pirogue/traffic_analysis/index.md:1:1": duplicate menu entry with identifier "Network traffic analysis" in menu "docs"
| WARN  "piroguetoolsuite.github.io/content/docs/prologue/overview.md:1:1": duplicate menu entry with identifier "Overview" in menu "docs"

Source Code: GitHub - PiRogueToolSuite/piroguetoolsuite.github.io: Source of the project website
Hugo Version: hugo v0.132.2-3fd26c70dff5934ec1802b9563530130ed1bca75+extended linux/amd64 BuildDate=2024-08-14T16:17:21Z VendorInfo=gohugoio

You have more than one page with the same menu identifier. For example:

  • content/docs/colander/traffic_analysis/index.md
  • content/docs/pirogue/traffic_analysis/index.md

You have not explicity set the menu identifier or name for either of these pages, so both fallback to the page title, and both pages have the same title.

You need to explicitly set the identifier for these menu entries.

https://gohugo.io/content-management/menus/#properties-front-matter

identifier

(string) Required when two or more menu entries have the same name, or when localizing the name using translation tables. Must start with a letter, followed by letters, digits, or underscores.

2 Likes

I tried adding the identifier as following. I don’t the want the site URIs to change as it might break the site.

title: "Network traffic analysis"
identifier: "Network traffic analysis with Colander"

This doesn’t seem to resolve the warnings.

To which of the two pages did you add the identifier?

When I add the identifier to content/docs/colander/traffic_analysis/index.md the warning goes away:

Start building sites … 
hugo v0.133.0-c9777473d1369f812d727a6c07dc57ad7be7bf62+extended linux/amd64 BuildDate=2024-08-17T19:57:41Z VendorInfo=gohugoio

WARN  "/home/jmooring/temp/piroguetoolsuite.github.io/content/docs/pirogue/architecture/index.md:1:1": duplicate menu entry with identifier "Architecture" in menu "docs"
WARN  "/home/jmooring/temp/piroguetoolsuite.github.io/content/docs/pirogue/overview/index.md:1:1": duplicate menu entry with identifier "Overview" in menu "docs"
WARN  "/home/jmooring/temp/piroguetoolsuite.github.io/content/docs/prologue/overview.md:1:1": duplicate menu entry with identifier "Overview" in menu "docs"
WARN  deprecated: .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in a future release. Use hugo.IsMultilingual instead.
WARN  deprecated: data.GetJSON was deprecated in Hugo v0.123.0 and will be removed in a future release. use resources.Get or resources.GetRemote with transform.Unmarshal.

                   |  EN   
-------------------+-------
  Pages            |  242  
  Paginator pages  |    5  
  Non-page files   |  175  
  Static files     |  146  
  Processed images | 1022  
  Aliases          |    5  
  Cleaned          |    0  

Total in 2294 ms