Table of contents
Part of the default page template.
Open this Table of contents in a new tab
HTML:
<nav class="toc" aria-labelledby="toc-label">
<h2 id="toc-label">Page contents</h2>
<ul>
<li><a href="#link-to-anchor-1">First heading</a>
<ul>
<li><a href="#link-to-sub-anchor-1">First subheading</a></li>
<li><a href="#link-to-sub-anchor-2">Second subheading</a></li>
</ul>
</li>
<li><a href="#link-to-anchor-2">Second heading</a></li>
<li><a href="#link-to-anchor-3">Third heading</a></li>
</ul>
</nav>
Considerations
Each link goes to a heading with an id
. The link path and id
need to match.