summaryrefslogtreecommitdiffstats
path: root/templates/macro.html
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-07-11 12:56:16 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-07-11 12:56:16 +0200
commit5e7de9d3f5269ce37882f445fa1855b57685b91e (patch)
tree1152f0335d205a243d2b786d2631dc14e19e5206 /templates/macro.html
parente77ef6e2a64298f5f14a762372d206d21e4f9d15 (diff)
Make burger() only apply to top-level of menu
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'templates/macro.html')
-rw-r--r--templates/macro.html29
1 files changed, 17 insertions, 12 deletions
diff --git a/templates/macro.html b/templates/macro.html
index 242b42e..cf7b7fe 100644
--- a/templates/macro.html
+++ b/templates/macro.html
@@ -1,15 +1,20 @@
+{% macro subtree(sec) %}
+ {% 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" />&nbsp;<a href="{{ subsection_item.permalink | safe }}">{{ subsection_item.title }}</a></li>
+ <ul id="subpages">
+ {{ macro::subtree(sec=subsection_item) }}
+ </ul>
+ {% endfor %}
+ {% for subpage in sec.pages %}
+ <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AUDFDoqfmnPqQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAC6SURBVEjH7ZTBCcIwFIa/lO6hA7iA6BCO4AZe/xHeCF49C4I7VOfQk2PUS4QibUzahiL0h0AOj7x87wtx+JhZTWQkLYFnTG1Bj5jZBVjE1LpvAknux+F1CkkvgkazB7DJ0kDSHniZ2RFY5yA4SToAKzO7d5EUoVk3V0fZWdLO11dt4gc58Ll62a1OBr2igJ8tcBuLoO0S1Wdfpt40lTALQTNlYI5ujAbTEaT8riHi2cHs4B8dpM5+coI3MpVSlNj0qyUAAAAASUVORK5CYII=" width="16px" />&nbsp;<a href="{{ subpage.permalink | safe }}">{{ subpage.title }}</a></li>
+ {% endfor %}
+{% endmacro subtree %}
+
{% macro tree(sec) %}
<a href="javascript:void(0);" onclick="burger()" id="mobile">&#9776;</a>
- <ul id="bger">
- {% 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" />&nbsp;<a href="{{ subsection_item.permalink | safe }}">{{ subsection_item.title }}</a></li>
- <ul id="subpages">
- {{ macro::tree(sec=subsection_item) }}
- </ul>
- {% endfor %}
- {% for subpage in sec.pages %}
- <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AUDFDoqfmnPqQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAC6SURBVEjH7ZTBCcIwFIa/lO6hA7iA6BCO4AZe/xHeCF49C4I7VOfQk2PUS4QibUzahiL0h0AOj7x87wtx+JhZTWQkLYFnTG1Bj5jZBVjE1LpvAknux+F1CkkvgkazB7DJ0kDSHniZ2RFY5yA4SToAKzO7d5EUoVk3V0fZWdLO11dt4gc58Ll62a1OBr2igJ8tcBuLoO0S1Wdfpt40lTALQTNlYI5ujAbTEaT8riHi2cHs4B8dpM5+coI3MpVSlNj0qyUAAAAASUVORK5CYII=" width="16px" />&nbsp;<a href="{{ subpage.permalink | safe }}">{{ subpage.title }}</a></li>
- {% endfor %}
- </ul>
+ <ul id="bger">
+ {{ macro::subtree(sec=sec) }}
+ </ul>
{% endmacro tree %}
+