How to refer to the title of a section, as a bookmark in a separate md file, by a menu link?

I have a Hugo-driven structure as below

- config
    - _default
        - menus.yaml

- content
    - authors
        - admin
            - _index.md
    - home
        - A.md
    

According to this structure, A is section of my home page. Now, what I want is when one presses a menu entry A_button, it jumps at the start of Section A in my home page. So, let’s say we have A.md as follows:

---
title: <div id="section-A">Section A</div>
subtitle: ''
---
Some text

But I don’t know how I should refer to this bookmark in my menus.yaml. In particular, the following does not work.

main:
  - name: Home
    url: '/index.html'
    weight: 1
  - name: A_button
    url: 'index.html/#section-A'
    weight: 10

How can I achieve this bookmarking?

Leave a Comment