Skip to content

Commit

Permalink
Include h3 to table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
britneywwc committed Nov 6, 2024
1 parent f658771 commit 9e81ab0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,18 @@ <h1 class="u-no-margin--bottom">{{ document.title }}</h1>
<div class="l-docs__sticky-container">
<aside class="p-table-of-contents">
<div class="p-table-of-contents__section">
<h4 class="p-table-of-contents__header">On this page</h4>
<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 9e81ab0

Please sign in to comment.