Aliases to page section

Greetings,

I am new to aliases. I want to redirect an old page to a sub-section of a new page. For example: example.com/garden to example.com/#garden how can I do this? I have read https://gohugo.io/content-management/urls/ but when I put the following code in the header I still resolve to page /garden

aliases:
    - /#garden

Hi! I am not quite sure whether I understand correctly because your title is “figure shortcode”.

You can ‘import’ a markdown file using a readfile shortcode:

{{< readfile file="my-file.md" markdown="true" >}}

If my-file.md contains a heading “Garden” the id #garden will be generated by the markdown parser.

Alternative you can put a HTML heading right before your readfile command:

<h2 id="garden">Garden</h2>

Title was errant. Now clearer.

Thank you. Ok, I think I got it correctly.

An alias in front matter simply creates a new HTML file containing

<meta http-equiv=refresh content="0; url=/my-file/">

So this file cannot be a section of another file.

Yet, the method mentioned above should work.