Back to Minikube

Sidebar Tree

site/layouts/partials/sidebar-tree.html

1.38.12.2 KB
Original Source

{{/* minikube hack: temporarily forked from docsy/layouts/partials/sidebar-tree.html for hugo v0.69 compatibility */}} {{/* We cache this partial for bigger sites and set the active class client side. */}} {{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}

{{ if not .Site.Params.ui.sidebar_search_disable }} {{ partial "search-input.html" . }} {{ end }} {{ define "section-tree-nav-section" }} {{ $s := .section }} {{ $p := .page }} {{ $shouldDelayActive := .delayActive }} {{ $activeSection := eq $p.CurrentSection $s }} {{/* minikube hack: Override $showSection due to a Hugo upgrade bug */}} {{ $showSection := false }} {{ $expandSection := false }} {{ $sid := $s.RelPermalink | anchorize }} {{ $sectionParent := $s.Parent.Title | anchorize }} {{ $csid := $p.CurrentSection.Title | anchorize }} {{ if $p.IsDescendant $s }}{{ $showSection = true }} {{ else if eq $sectionParent "minikube" }}{{ $showSection = true }} {{ else if eq $sectionParent "welcome" }}{{ $showSection = true }} {{ else if eq $sectionParent "handbook" }}{{ $showSection = true }} {{ else if eq $p.CurrentSection $s.Parent }}{{ $showSection = true }} {{ else if $p.Parent.IsAncestor $s }}{{ if eq $s $p.CurrentSection }} {{ $showSection = true }} {{ end }} {{ end }}{{/* end minikube hack */}} {{ $sid := $s.RelPermalink | anchorize }} {{ if $showSection }}

  • {{$s.LinkTitle }}

    • {{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }} {{ $pages := $pages | first 50 }} {{ range $pages }} {{ if .IsPage }} {{ $mid := printf "m-%s" (.RelPermalink | anchorize) }} {{/* minikube hack: Override $activeSection due to a Hugo upgrade bug */}} {{ $showPage := false }} {{ $activePage := false }} {{ if $activeSection }} {{ $showPage = true }} {{ $activePage = eq . $p }} {{ end }} {{ if eq $s.Title "Handbook" }} {{ if lt (len $p.CurrentSection.Pages) 7 }} {{ $showPage = true }} {{ end }} {{ if eq $csid "welcome" }} {{ $showPage = true }} {{ end }} {{ end }} {{ if $showPage }} {{.LinkTitle }} {{ end }} {{/* end minikube hack */}} {{ else }} {{ template "section-tree-nav-section" (dict "page" $p "section" .) }} {{ end }} {{ end }}

{{ end }} {{ end }}