Skip to content

Commit

Permalink
Merge pull request #200 from canonical/h3-toc
Browse files Browse the repository at this point in the history
Include h3 to table of contents
  • Loading branch information
britneywwc authored Nov 6, 2024
2 parents f658771 + 4c55cad commit 79c84ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ <h4 class="p-table-of-contents__header">On this page</h4>
<nav class="p-table-of-contents__nav" aria-label="Table of contents">
<ul class="p-table-of-contents__list">
{% for heading in document.headings_map %}
<li class="p-table-of-contents__item"><a class="p-table-of-contents__link" href="#{{ heading.heading_slug }}">{{ heading.heading_text }}</a></li>
<li class="p-table-of-contents__item"><a class="p-table-of-contents__link" href="#{{ heading.heading_slug }}">{{ heading.heading_text }}</a></li>
{% if heading.children %}
<ul class="p-table-of-contents__list">
{% for child in heading.children %}
<li class="p-table-of-contents__item"><a class="p-table-of-contents__link" href="#{{ child.heading_slug }}">{{ child.heading_text }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
</nav>
Expand Down

0 comments on commit 79c84ff

Please sign in to comment.