Our site using Hugo has several groups of markdown files that share the same title, but are differentiated by their file path and name. When trying to build the site, hugo puts out errors like
Two or more menu items have the same name/identifier in Menu “main”: “Notifications”.
Is there any way that two files can have the same title as long as they sit in different paths?
The error is about duplicate menu items. Looks like you have two menu items with same identifier (Notifications). Pick one of them and set an unique identifier (can be anything).
I have a dual language site with content files with the same name and slug, but in separate folders.
If you specify menus in front-matter, copy pasting can cause trouble. Be sure to change the identifier as @bep mentioned. I got the same error but checked all menu items in config files and frontmatter to find the dupe.
The identifier is used to identify a menu item. So it must be unique within a menu (or the duplicate will be ignored – hence the error message).
It gets it value from menu item name if not set. I haven’t looked so I’m not 100% sure what value is used as key if neither are set. The main thing is: To fix this, add an identifier to one of the duplicates.
I ran into this problem. I had two files with the same “title” both off of [main.menu] but different parents. I was able to fix it by adding an identifier to one of the files. Took a long time to debug — I am building a single site by drawing content from multiple GIHub repos.
Debugging took a bit because my content was coming from 6 different locations. It would great if Hugo were to throw an error when it encounters duplicate identifiers or titles (when identifiers are not in use.)