{{- end }}
</ul>
<h2 class="nav submenu">
- <span class="s">Submenu for section</span>
- <a class="s selected" href="../projects.html" th:href="@{${section}}" th:text="${_titles.get(section)}">Projects</a>
+ <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
</h2>
- {{- with index site.Menus $menuID }}
- <ul id="submenu" class="s selected">
- {{- partial "inline/menu/tree.html" (dict "pages" $page.Site.Sections "current" $page) }}
- </ul>
- {{- end }}
+ <ul class="submenu selected">
+ {{- partial "inline/menu/tree.html" (dict "pages" $page.Site.Sections "current" $page) }}
{{- define "_partials/inline/menu/tree.html" }}
{{- $current := .current -}}
{{- $pages := .pages -}}
- {{- $isCurrent := eq . $current -}}
- {{- $isAncestor := $current.IsDescendant . -}}
- <ul class="submenu">
{{- range $pages }}
-
+ {{- $isCurrent := eq . $current -}}
+ {{- $isAncestor := $current.IsDescendant . -}}
<li
- class="
- page-tree__item
- {{ if $isCurrent }} is-current{{ end }}
- {{ if $isAncestor }} is-ancestor{{ end }}
- "
- >
+ class="s{{ if or $current.Pages $current.Sections}} sub{{ end }}">
+ <!--
+ th:with="
+ child=${pos == len},
+ hidden=${!child && _canonical.get(crumbs.get(pos)) == entry},
+ entry=${hidden?crumbs.get(pos):entry},
+ selected=${(child and crumbs.get(pos-1) + '?about' == entry) or (!child and (crumbs.get(pos) == entry or hidden))},
+ leaf=${pos >= (len - 1) and not selected},
+ sibling=${pos + 1 == len and (_childs.get(uri) == null or uri == parent)},
+ childs=${entry == parent ? null : _childs.get(entry)}
+ "
+ class="s sub"
+ th:class="'s' + (${childs} ? ' sub' : '') + (${selected or sibling or child} ? '' : ' off')"
+ -->
<a href="{{ .RelPermalink }}">
{{ .Title }}
</a>
-
+ <ul class="submenu{{ if (or $isCurrent $isAncestor) }} selected{{ end }}">
{{- if .Pages }}
{{- partial "inline/menu/tree.html" (dict
"pages" .Pages
"current" $current
) }}
{{- end }}
+ </ul>
</li>
-
{{- end }}
- </ul>
{{- end }}
+ </ul>
<ul th:include="${submenu}?:_"
th:with="