{{- $context := .context -}} {{- $disableSidebar := .disableSidebar | default false -}} {{- $displayPlaceholder := .displayPlaceholder | default false -}} {{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hidden xl:block" "md:hidden") "md:sticky" -}} {{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}} {{- $pageURL := $context.RelPermalink -}} {{- define "partials/sidebar/mobile-search" -}}
{{- partialCached "search.html" . -}}
{{- end -}} {{- define "sidebar-item-link" -}} {{- $external := strings.HasPrefix .link "http" -}} {{- .title | htmlUnescape | safeHTML -}} {{- with .context }} {{- if or .RegularPages .Sections .section }}{{ partialCached "sidebar/collapsible-button" . }}{{ end -}} {{ end -}} {{- end -}} {{- define "partials/sidebar/switches" -}} {{- $context := .context -}} {{- $disableSidebar := .disableSidebar -}} {{/* Hide theme switch when sidebar is disabled */}} {{ $switchesClass := cond $disableSidebar "md:hidden" "" -}} {{ $displayThemeToggle := (site.Params.theme.displayToggle | default true) -}} {{ if or site.IsMultiLingual $displayThemeToggle }}
{{- with site.IsMultiLingual -}} {{- partial "language-switch" (dict "context" $context "grow" true) -}} {{- with $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}} {{- else -}} {{- with $displayThemeToggle -}}
{{ partial "theme-toggle" }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}