]> juplo.de Git - website/commitdiff
WIP:layout:menu
authorKai Moritz <kai@juplo.de>
Sun, 14 Dec 2025 11:03:05 +0000 (12:03 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 14 Dec 2025 17:45:14 +0000 (18:45 +0100)
layouts/_partials/menu.html

index b9b8732858338c24c4cc8e30105ad7083367a596..e21f107d17dbd7880e513c2e30bb9f61c1b78bf1 100644 (file)
     <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
   </h2>
   <ul id="submenu" class="submenu selected">
-  {{- partial "inline/menu/tree.html" (dict "pages" $page.Site.Sections "current" $page) }}
+  {{- partial "inline/menu/tree.html" (dict "pages" $page.Site.Sections "page" $page) }}
   {{- define "_partials/inline/menu/tree.html" }}
-  {{- $current := .current -}}
+    {{- $page := .page }}
     {{- range .pages }}
-    {{- $isCurrent := eq . $current -}}
-    {{- $isAncestor := $current.IsDescendant . -}}
-    <li class="s{{ if or .Pages .Sections}} sub{{ end }}{{ if not (or (eq $current .) ($current.IsDescendant .))}} off{{ end }}">
+    {{- $isCurrent := eq . $page -}}
+    {{- $isAncestor := $page.IsDescendant . -}}
+    <li class="s{{ if or .Pages .Sections}} sub{{ end }}{{ if not (or (eq $page .) ($page.IsDescendant .))}} off{{ end }}">
       <!--
         th:with="
             child=${pos == len},
@@ -46,7 +46,7 @@
         {{- if .Pages }}
           {{- partial "inline/menu/tree.html" (dict
               "pages" .Pages
-              "current" $current
+              "page" $page
           ) }}
         {{- end }}
       </ul>