diff --git a/web/layouts/partials/docs/sidebar.html b/web/layouts/partials/docs/sidebar.html index c3ddbfb6e5a5ebca33741bb5cfd87447ecad3244..109225578d7c2eebb856a47e5171ab44c1d18460 100644 --- a/web/layouts/partials/docs/sidebar.html +++ b/web/layouts/partials/docs/sidebar.html @@ -37,7 +37,7 @@ {{ end }} <div class="md:flex md:shrink-0"> - <nav class="w-48 md:w-64 lg:w-72 pl-2 pr-4 mt-1 text-sm lg:text-base overflow-y-scroll h-screen sticky top-0"> + <nav class="w-48 md:w-64 lg:w-72 pl-2 pr-4 mt-1 text-sm lg:text-base overflow-y-auto h-screen sticky top-0"> {{ $currentMenu := index .Site.Menus "docs" }} {{ range $currentMenu }} {{ $url_first_char := substr .URL 0 2 }} @@ -54,12 +54,40 @@ <hr class="mt-3"> <ul> {{ range $baseSubsection.Sections }} - <li class="tracking-wide font-bold mt-6"> - {{ if .Params.breadcrumbs }}<a href="{{ .Permalink }}">{{ end }} - <span {{if eq .RelPermalink $subSubsection.RelPermalink }} class="text-brand-500" {{end}}>{{ .Title | upper }}</span> - {{ if .Params.breadcrumbs }}</a>{{ end }} + {{ if .Params.collapsed }} + {{ if eq .RelPermalink $subSubsection.RelPermalink }} + <li class="tracking-wide font-bold mt-6"> + {{ else }} + <li class="tracking-wide font-bold mt-3"> + {{ end }} + {{ else }} + <li class="tracking-wide font-bold mt-6"> + {{ end }} + {{ if .Params.collapsed }} + {{ range first 1 .Pages }} + <a href="{{ .Permalink }}"> + {{ end }} + {{ end }} + {{ if .Params.breadcrumbs }} + <a href="{{ .Permalink }}"> + {{ end }} + <span {{ if eq .RelPermalink $subSubsection.RelPermalink }} class="text-brand-500" {{end}}> + {{ .Title | upper }} + {{ if .Params.collapsed }} + {{ if eq .RelPermalink $subSubsection.RelPermalink }} + <i class="fal fa-caret-down"></i> + {{ else }} + <i class="fal fa-caret-right"></i> + {{ end }} + {{ end }} + </span> + {{ if or .Params.breadcrumbs .Params.collapsed }} + </a> + {{ end }} </li> - {{ template "subpages" (dict "indexRelPermalink" $indexRelPermalink "context" .) }} + {{ if or (not .Params.collapsed) (eq .RelPermalink $subSubsection.RelPermalink) }} + {{ template "subpages" (dict "indexRelPermalink" $indexRelPermalink "context" .) }} + {{ end }} {{ end }} </ul> <hr class="mt-3">