diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-07-07 09:05:22 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-07-07 09:05:22 +0200 |
commit | 6a9aecc9a83f5643374af2c67d06120f4cab127f (patch) | |
tree | d743af1689aa38b07bc97bdca26a656deaa1ea21 /templates/macro.html | |
parent | e943b51bb13f187aa3d317033206643ea96343e2 (diff) |
Make macro recursive
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'templates/macro.html')
-rw-r--r-- | templates/macro.html | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/templates/macro.html b/templates/macro.html index c89f094..242b42e 100644 --- a/templates/macro.html +++ b/templates/macro.html @@ -1,23 +1,15 @@ -{% macro tree() %}
+{% macro tree(sec) %}
<a href="javascript:void(0);" onclick="burger()" id="mobile">☰</a>
<ul id="bger">
- {% for subsection in section.subsections | sort %}
+ {% for subsection in sec.subsections | sort %}
{% set subsection_item = get_section(path=subsection) %}
<li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAaElEQVRIx2NgGOqAEcZgZefQb25suIBPcW19g8Hvnz8ukmwBKzuHQHNjw3tiNFRUVDCSZAExLicX1NY3ODJ2dHT8ZxgF+OKA1kHERGsfjFowasGoBaMWEGNBbX2DI60Mr61vkBr69QEAFDIY9Yz1owAAAAAASUVORK5CYII=" width="16px" /> <a href="{{ subsection_item.permalink | safe }}">{{ subsection_item.title }}</a></li>
<ul id="subpages">
-
- {% for subsc in subsection_item.subsections | sort %}
- <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAaElEQVRIx2NgGOqAEcZgZefQb25suIBPcW19g8Hvnz8ukmwBKzuHQHNjw3tiNFRUVDCSZAExLicX1NY3ODJ2dHT8ZxgF+OKA1kHERGsfjFowasGoBaMWEGNBbX2DI60Mr61vkBr69QEAFDIY9Yz1owAAAAAASUVORK5CYII=" width="16px" /> <a href="{{ subsection_item.permalink | safe }}">{{ subsection_item.title }}</a></li>
- {% endfor %}
-
- {% for subpage in subsection_item.pages %}
- <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AUDFDoqfmnPqQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAC6SURBVEjH7ZTBCcIwFIa/lO6hA7iA6BCO4AZe/xHeCF49C4I7VOfQk2PUS4QibUzahiL0h0AOj7x87wtx+JhZTWQkLYFnTG1Bj5jZBVjE1LpvAknux+F1CkkvgkazB7DJ0kDSHniZ2RFY5yA4SToAKzO7d5EUoVk3V0fZWdLO11dt4gc58Ll62a1OBr2igJ8tcBuLoO0S1Wdfpt40lTALQTNlYI5ujAbTEaT8riHi2cHs4B8dpM5+coI3MpVSlNj0qyUAAAAASUVORK5CYII=" width="16px" /> <a href="{{ subpage.permalink | safe }}">{{ subpage.title }}</a></li>
- {% endfor %}
+ {{ macro::tree(sec=subsection_item) }}
</ul>
- {% else %}
- {% for subpage in section.pages %}
- <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AUDFDoqfmnPqQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAC6SURBVEjH7ZTBCcIwFIa/lO6hA7iA6BCO4AZe/xHeCF49C4I7VOfQk2PUS4QibUzahiL0h0AOj7x87wtx+JhZTWQkLYFnTG1Bj5jZBVjE1LpvAknux+F1CkkvgkazB7DJ0kDSHniZ2RFY5yA4SToAKzO7d5EUoVk3V0fZWdLO11dt4gc58Ll62a1OBr2igJ8tcBuLoO0S1Wdfpt40lTALQTNlYI5ujAbTEaT8riHi2cHs4B8dpM5+coI3MpVSlNj0qyUAAAAASUVORK5CYII=" width="16px" /> <a href="{{ subpage.permalink | safe }}">{{ subpage.title }}</a></li>
- {% endfor %}
+ {% endfor %}
+ {% for subpage in sec.pages %}
+ <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AUDFDoqfmnPqQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAC6SURBVEjH7ZTBCcIwFIa/lO6hA7iA6BCO4AZe/xHeCF49C4I7VOfQk2PUS4QibUzahiL0h0AOj7x87wtx+JhZTWQkLYFnTG1Bj5jZBVjE1LpvAknux+F1CkkvgkazB7DJ0kDSHniZ2RFY5yA4SToAKzO7d5EUoVk3V0fZWdLO11dt4gc58Ll62a1OBr2igJ8tcBuLoO0S1Wdfpt40lTALQTNlYI5ujAbTEaT8riHi2cHs4B8dpM5+coI3MpVSlNj0qyUAAAAASUVORK5CYII=" width="16px" /> <a href="{{ subpage.permalink | safe }}">{{ subpage.title }}</a></li>
{% endfor %}
</ul>
{% endmacro tree %}
|