make guide sections a macro

This commit is contained in:
2025-12-04 08:52:22 +03:00
parent b812e01473
commit 265e249eaf
2 changed files with 200 additions and 195 deletions

View File

@@ -287,3 +287,21 @@
</div>
</div>
{% endmacro %}
{% macro guide_sections() %}
<div class="guide-container">
<div class="guide-topics">
{% set sections %}{{ caller() }}{% endset %}
{{ sections | safe }}
</div>
<div class="guide-toc">
<h2>Table of contents</h2>
{% set toc = sections | extract_h2 %}
<ul>
{% for heading in toc %}
<li><a href='#{{ heading.id }}'>{{ heading.text }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endmacro %}