|
8 | 8 | {{ $isExpandableSection := and (eq $current.CurrentSection .) (ne .FirstSection .) }} |
9 | 9 | {{ $shouldExpand := or $isCurrentPage $isExpandableSection }} |
10 | 10 | {{ $sectionId := substr (sha1 .Permalink) 0 8 }} |
11 | | - |
| 11 | + |
12 | 12 | {{/* Check if this is an empty section page */}} |
13 | 13 | {{ $isEmptySection := and .IsSection (eq (len .Content) 0) (gt (len .Pages) 0) }} |
14 | 14 | {{ $shouldLink := not (or .Page.Params.nolink $isEmptySection) }} |
15 | | - |
| 15 | + |
16 | 16 | {{ if not .Page.Params.tocHidden }} |
17 | 17 | <div class="section-container container pe-0 pt-1"> |
18 | 18 | {{/* Add expand/collapse controls for sections with children */}} |
19 | 19 | {{ $hasChildren := and .IsSection (ne .FirstSection .) (gt (len .Pages) 0) }} |
20 | | - |
21 | | - <div |
| 20 | + |
| 21 | + <div |
22 | 22 | class="container nav-container pe-0 d-flex w-100 {{ if $isCurrentPage }}active{{ else if $shouldExpand }}active-parent{{ end }}" |
23 | 23 | {{ if $hasChildren }} |
24 | | - data-bs-toggle="collapse" |
25 | | - data-bs-target="#collapse-{{ $sectionId }}" |
| 24 | + data-bs-toggle="collapse" |
| 25 | + data-bs-target="#collapse-{{ $sectionId }}" |
26 | 26 | aria-expanded="{{ if $shouldExpand }}true{{ else }}false{{ end }}" |
27 | 27 | role="button" |
28 | 28 | tabindex="0" |
29 | 29 | {{ end }} |
30 | 30 | > |
31 | | - |
| 31 | + |
32 | 32 | {{/* Render link or span based on content and nolink parameter */}} |
33 | 33 | {{ if and $shouldLink (not $hasChildren) }} |
34 | 34 | <a class="d-flex w-100 border-0" href="{{ .Permalink }}">{{ .Title }}</a> |
35 | 35 | {{ else }} |
36 | 36 | <span class="d-flex w-100 border-0">{{ .Title }}</span> |
37 | 37 | {{ end }} |
38 | | - |
| 38 | + |
39 | 39 | {{ if $hasChildren }} |
40 | 40 | <div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"> |
41 | 41 | <input |
|
52 | 52 | <use xlink:href="#x"></use> |
53 | 53 | </svg> |
54 | 54 | </label> |
55 | | - </div> |
| 55 | + </div> |
56 | 56 | {{ end }} |
57 | 57 | </div> |
58 | | - |
| 58 | + |
59 | 59 | {{/* Render child pages for non-root sections */}} |
60 | 60 | {{ if ne .FirstSection . }} |
61 | 61 | {{ range .Pages }} |
|
80 | 80 | {{ end }} |
81 | 81 | {{ end }} |
82 | 82 | {{ end }} |
83 | | - |
| 83 | + |
84 | 84 | {{/* Include additional sidebar sections */}} |
85 | 85 | {{ if not ($.Param "docs") }} |
86 | 86 | {{ partialCached "sidebar/user-docs" . }} |
|
0 commit comments