Hey everyone,
I need some help with modifying the menu section of the template I’m using.
The navigation menu in my template is managed through hugo.tml
and looks like this:
[menu] # Menu management
[[menu.main]]
name = 'Home'
pageRef = '/'
weight = 10
[[menu.main]]
name = 'About'
pageRef = '/about'
weight = 15
[[menu.main]]
name = 'Contact'
pageRef = '/contact'
weight = 20
This menu appears in two places: the footer and the top menu of the template. The issue is that the links in both locations are duplicated.
What I’m asking is how can I change the menu items that appear at the top so they aren’t duplicated?
link to theme on github
https://github.com/fauzanmy/pehtheme-hugo?tab=readme-ov-file
Thanks!
irkode
June 14, 2024, 8:02am
3
rereading the question ;-):
looks like this is intentionally by the theme
the footer menu is static for all pages in the site. it shows the top-level entries only
the header menu is generated by a partial that walks the menu tree and does something (didn’t dig in details there)
The theme you are using does not provide options to configure that. You will have to do that manually by overriding the template using standard Hugo functionality.
copy the template/partial you want to change from theme folder to your layouts
folder
Change your local copy to match your needs
Described in the docs:
You might get a more accurate answer by asking the theme author Issues · fauzanmy/pehtheme-hugo · GitHub
as a fast approach you could
copy themes\pehtheme-hugo\layouts\partials\header.html
to your local layouts
change the menu name from “main” to “mymenu” (line 73)
define your own menu in config file[[menu.mymenu]]
identifier = "about"
name = "About"
url = "/about"
weight = 1
[[menu.mymenu]]
identifier = "Another Entry"
name = "Anotherone"
url = "/next"
weight = 2
1 Like
@irkode
Thanks a lot for your help! I really appreciate it.
system
Closed
June 16, 2024, 9:47am
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.