{{ .Title }}
{{ range where .Site.Params.sidebar.item "name" $.Section }} {{ range where $.Site.Pages ".Params.section" .name }} {{ $active := (eq $.Title .Title) }} {{ $expanded := or (eq $.Params.subsection .Title) $active (eq $.Parent.Params.subsection .Title) }} {{ $.Scratch.Set "icon" "fa-plus-square-o" }} {{ if $expanded }} {{ $.Scratch.Set "icon" "fa-minus-square-o" }} {{ end }} {{if eq (len (.Pages)) 0}} {{ $.Scratch.Set "iconstyle" "display: none" }} {{ else }} {{ $.Scratch.Set "iconstyle" "" }} {{ end }} {{ if $active }} {{ .Title }} {{ else }} {{ .Title }} {{ end }}
    {{ range .Pages.ByWeight }} {{ $subactive := (eq $.Title .Title) }} {{ $subexpanded := or (eq .Title $.Params.subsection) $subactive }} {{ $.Scratch.Set "subicon" "fa-plus-square-o" }} {{ if $subexpanded }} {{ $.Scratch.Set "subicon" "fa-minus-square-o" }} {{ end }} {{if eq (len (.Pages)) 0}} {{ $.Scratch.Set "iconstyle" "display: none" }} {{ else }} {{ $.Scratch.Set "iconstyle" "" }} {{ end }} {{ if $subactive }} {{ .Title }} {{ else }} {{ .Title }} {{ end }}
      {{ range .Pages.ByWeight }} {{ .Title }} {{ end }}
    {{ end }}
{{ end }} {{ end }}