Skip to content

Commit 59b45c4

Browse files
Merge pull request #664 from canonical/WD-17308
WD-17308 Include H3 in docs TOC
2 parents ca9b59b + dcf7736 commit 59b45c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

templates/docs/document.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ <h4 class="p-table-of-contents__header">On this page</h4>
118118
<nav class="p-table-of-contents__nav" aria-label="Table of contents">
119119
<ul class="p-table-of-contents__list">
120120
{% for heading in document.headings_map %}
121-
<li class="p-table-of-contents__item"><a class="p-table-of-contents__link" href="#{{ heading.heading_slug }}">{{ heading.heading_text }}</a></li>
121+
<li class="p-table-of-contents__item"><a class="p-table-of-contents__link" href="#{{ heading.heading_slug }}">{{ heading.heading_text }}</a></li>
122+
{% if heading.children %}
123+
<ul class="p-table-of-contents__list">
124+
{% for child in heading.children %}
125+
<li class="p-table-of-contents__item"><a class="p-table-of-contents__link" href="#{{ child.heading_slug }}">{{ child.heading_text }}</a></li>
126+
{% endfor %}
127+
</ul>
128+
{% endif %}
122129
{% endfor %}
123130
</ul>
124131
</nav>

0 commit comments

Comments
 (0)