{{- partial "inline/menu/tree.html" (dict "pages" $page.Site.Sections "current" $page) }}
</ul>
{{- end }}
+ {{- define "_partials/inline/menu/tree.html" }}
+ {{- $current := .current -}}
+ {{- $pages := .pages -}}
+ {{- $isCurrent := eq . $current -}}
+ {{- $isAncestor := $current.IsDescendant . -}}
+ <ul class="submenu">
+ {{- range $pages }}
+
+ <li
+ class="
+ page-tree__item
+ {{ if $isCurrent }} is-current{{ end }}
+ {{ if $isAncestor }} is-ancestor{{ end }}
+ "
+ >
+ <a href="{{ .RelPermalink }}">
+ {{ .Title }}
+ </a>
+
+ {{- if .Pages }}
+ {{- partial "inline/menu/tree.html" (dict
+ "pages" .Pages
+ "current" $current
+ ) }}
+ {{- end }}
+ </li>
+
+ {{- end }}
+ </ul>
+ {{- end }}
<ul th:include="${submenu}?:_"
th:with="
</ul>
<hr class="n"/>
</nav>
-{{- define "_partials/inline/menu/tree.html" }}
-{{- $current := .current -}}
-{{- $pages := .pages -}}
-
-<ul class="page-tree">
- {{- range $pages }}
-
- {{- $isCurrent := eq . $current -}}
- {{- $isAncestor := $current.IsDescendant . -}}
-
- <li
- class="
- page-tree__item
- {{ if $isCurrent }} is-current{{ end }}
- {{ if $isAncestor }} is-ancestor{{ end }}
- "
- >
- <a href="{{ .RelPermalink }}">
- {{ .Title }}
- </a>
-
- {{- if .Pages }}
- {{- partial "inline/menu/tree.html" (dict
- "pages" .Pages
- "current" $current
- ) }}
- {{- end }}
- </li>
-
- {{- end }}
-</ul>
-{{- end }}