Undeclared menu items showing in menu

I have 5 menu items declared in config.toml and the menu is being called in nav.html. But 7 menu items are being displayed? Granted the 2 extras menu items are for content of my site but given they’re not declared in menu config.toml how/why are they displaying?

config.toml

[menus]
  [[menu.main]]
      name = "r3"
      url = "/r3/"
      pre = "r3"
      weight = 1
  [[menu.main]]
      name = "r8"
      url = "/r8/"
      pre = "r8"
      weight = 2
  [[menu.main]]
      name = "reviews"
      url = "/reviews/"
      pre = "reviews"
      weight = 3
  [[menu.main]]
      name = "faqs"
      url = "/faqs/"
      pre = "faqs"
      weight = 4
  [[menu.main]]
      name = "buy now"
      url = "/buy"
      pre = "buynow"
      weight = 5

nav.html

{{ if .Site.Menus.main }}
   {{ range .Site.Menus.main }}
       <a class="{{ if eq $currentPageUrl .URL }} o-50{{end}}" href="{{ .URL }}" title="{{ .URL }} page">{{ .Name }}</a>
   {{ end }}
{{ end }}

Have you checked the front matter of your posts. I think you can declare menu items there as well.

menu:
  main:
    identifier: Menu Item
    parent: parent menu
weight: 10

For example you could update the identifier in front matter to create a new menu item. Parent is optional.

1 Like

Thanks for the suggestion @thewebmastercom. I mangled to solve the riddle by renaming my menu from menu.main to menu.somethingelse, but still I don’t understand it what was happening.

When I have the menu declared as menu.main then undeclared menu items for my parent Sections show in my menu. For example, I have “Pages” and “Products” Sections and links to /pages and /products appear in my menu.

When I rename the menu in config.toml and my nav.html then the menu works as expected showing only the menu links specifically declared in my menu config.toml settings.