Skip to content
Snippets Groups Projects
Verified Commit 715eda9f authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Added section option collapsed.

parent 80675ea5
No related branches found
No related tags found
No related merge requests found
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment