{{- define "_partials/inline/menu/tree.html" }}
{{- $current := .current -}}
{{- 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 . $current -}}
+ {{- $isAncestor := $current.IsDescendant . -}}
+ <li class="s{{ if or .Pages .Sections}} sub{{ end }}{{ if not (or (eq $current .) ($current.IsDescendant .))}} off{{ end }}">
<!--
th:with="
child=${pos == len},
class="s sub"
th:class="'s' + (${childs} ? ' sub' : '') + (${selected or sibling or child} ? '' : ' off')"
-->
- <a href="{{ .RelPermalink }}" class="s {{ if (or $isCurrent $isAncestor) }} selected{{ end }}">{{ .Title }}</a>
- <ul class="submenu{{ if (or $isCurrent $isAncestor) }} active{{ end }}">
+ <a href="{{ .RelPermalink }}"
+ class="s {{ if (or $isCurrent $isAncestor) }} selected{{ end }}"
+ >{{ .Title }}</a>
+ {{ if or .Pages .Sections }}
+ <ul class="submenu{{ if (or $isCurrent $isAncestor) }} active{{ end }}">
{{- if .Pages }}
{{- partial "inline/menu/tree.html" (dict
"pages" .Pages
"current" $current
) }}
{{- end }}
- </ul>
- </li>
+ </ul>
+ {{- end }}
+ </li>
{{- end }}
{{- end }}
</ul>