{{ $context := .context }} {{ $disableSidebar := .disableSidebar | default false }} {{ $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection }} {{ $navPages := union $navRoot.RegularPages $navRoot.Sections }} {{ $pageURL := $context.RelPermalink }} {{- define "sidebar-main" -}} {{ $pages := .pages }} {{ $toc := .toc | default false }} {{ $pageURL := .pageURL }} {{- with $pages -}} {{- range .ByWeight -}} {{ template "sidebar-item" (dict "item" . "pageURL" $pageURL "toc" $toc) }} {{ template "sidebar-tree" (dict "context" . "level" 1 "pageURL" $pageURL "toc" $toc) }} {{- end -}} {{ end }} {{- end -}} {{- define "sidebar-footer" -}} {{- range site.Menus.sidebar -}} {{ if eq .Params.type "separator" }}