Linking to a heading in the same page in Hugo
Feb 20, 2022 14:58 · 116 words · 1 minute read
Linking to another page in markdown in Hugo is easy: i.e.
[Auntie Beeb](https://www.bbc.co.uk/) renders as Auntie Beeb - but when you want a link to a heading in the same page I can never remember, so this is a quick aide-memoire:
In HTML a relative link to an element in the same page looks like:
<!-- <a> element links to the section below --> <p><a href="#Section_further_down"> Jump to the heading below </a></p> <!-- Heading to link to --> <h2 id="Section_further_down">Section further down</h2>
In Hugo to achieve the same effect:
<!-- <a> element links to the section below --> [Jump to the heading below](#section-further-down) <!-- Heading to link to --> ## Section further down