I have a heading that’s halfway down on my homepage and I would like to link to this heading in my navbar menu. I tried adding it as a new menu entry in my toml file. I used pageRef=‘/#heading-id’ but it did not work.
Is it possible to add this heading to my menu somehow?
I have had a look at the Hugo docs page on menus but I couldn’t see how.
Thanks. Unfortunately I’m still a beginner with Hugo and I’m struggling with your partial above. I completely replaced my menu.html partial with your suggestion but I’m getting an error on the “range” line:
render: failed to render pages: range can’t iterate over [lists some memory addresses]
Don’t want to come across as lazy but I’m just wondering if anything comes to your mind, since I’m trying your suggestion.
I’ve revised the code above to use the menu params key.
Try it:
git clone --single-branch -b hugo-forum-topic-53592 https://github.com/jmooring/hugo-testing hugo-forum-topic-53592
cd hugo-forum-topic-53592
hugo server