Two "Simple" Menu Questions

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).

  1. 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”.

  1. 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"

As such happens, I immediately tried to do it again and solved question #1 myself after bringing up the project for the first time today.

The second part remains a question.

No, it is not.

Update on Question 1. I found that the following configuration does not work:

main:
  - identifier: directions
    name: Directions
    url: "/#directions"
    weight: 100
    parent: ""

The idea being that I want to present a top-level menu item to links directly to a sub-section on the main page. This was the problem I was having last night and I can still replicate it (the url gets stripped to “/” when the menu is built).

However, specifying a parent other than “”:

main:
  - identifier: directions
    name: Directions
    url: "/#directions"
    weight: 100
    parent: "about"

It works. Why is that?