Good morning.
As a newcomer to Hugo, I have a basic grasp on the menu system and I can get a basic menu/submenu working using static config and front matter properly.
What I was trying to do. I was adding a page to the site which had some notable subsections that a person might wish to jump quickly to. I am typically relying on page front matter to make individual pages responsible for their presence in the main menu (rather than editing static config). I wanted the new page to inform the system not only of its position in the menu system, but also that it had a submenu of local links on the page for the user, so that the menu would present something like:
Home About Contact
+ Directions
where the About Page (content/about.md) had front matter that that identified itself and a submenu link to a section on About page (/about/#directions).
- EDIT SOLVED Links to named anchors. How does one specify a named anchor menu item? For example, /somepage#section? When I try something like:
menu:
main:
identifier: "googlemap"
url: "/about#map"
name: "Directions"
parent: "about"
weight: 200
...
The # part of the url either gets stripped (the URL is presented as just /about"), or I get a weird junk string like “AstQ?zzzTb”.
- Sublevel menus in front matter. Is it possible to specify sub-level menus in the front matter of a page (similar to how one might do so in the static config)? My attempts at this caused Hugo to present front matter parsing errors.
hugo v0.91.2+extended darwin/amd64 BuildDate=unknown
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.17.6"