Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Docs: Limit TOC to H2 for improved readability

Maximilian Roos5c6273dd7e4b
diff --git a/docs/templates/macros.html b/docs/templates/macros.html
index 445a4d71f..66a636b8e 100644
--- a/docs/templates/macros.html
+++ b/docs/templates/macros.html
@@ -18,22 +18,15 @@
</a>
</div>
- {# Show page TOC for current page #}
+ {# Show page TOC for current page (h2s only) #}
{% if is_current and current_page.toc %}
{% for h in current_page.toc %}
+ {% if h.level == 2 %}
<div class="toc-item-child">
<a class="subtext" href="{{ h.permalink | safe }}">
<small>{{ h.title }}</small>
</a>
</div>
- {% if h.children %}
- {% for h2 in h.children %}
- <div class="toc-item-child nested">
- <a class="subtext" href="{{ h2.permalink | safe }}">
- <small>{{ h2.title }}</small>
- </a>
- </div>
- {% endfor %}
{% endif %}
{% endfor %}
{% endif %}