h $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}}
      {{- else -}}
        {{- with $displayThemeToggle -}}
          <div class="flex grow flex-col">{{ partial "theme-toggle" }}</div>
        {{- end -}}
      {{- end -}}
    </div>
  {{- end -}}
</aside>

{{- define "sidebar-main" -}}
  {{ template "sidebar-tree" (dict "context" .context "level" 0 "page" .page "pageURL" .pageURL "toc" (.toc | default false)) }}
{{- end -}}

{{- define "sidebar-tree" -}}
  {{- if ge .