Skip to content

Commit

Permalink
Merge pull request #564 from canonical/discourse-toc-fix
Browse files Browse the repository at this point in the history
Include h3 to docs table of contents
  • Loading branch information
britneywwc authored Nov 6, 2024
2 parents 38f8fec + 1d75462 commit 01be91f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion templates/docs/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,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 01be91f

Please sign in to comment.