Skip to content

Commit

Permalink
updated sub-navigation layout condition (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrying authored Oct 7, 2023
1 parent 55902c0 commit ff4dd38
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions layouts/partials/sidebar/auto-collapsible-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,12 @@
</div>
<div class="collapse{{ if $active }} show{{ end }}" id="section-{{ md5 .LinkTitle }}">
<ul class="btn-toggle-nav list-unstyled fw-normal small">
{{ range where .Pages ".Params.unlisted" "!=" "true" }}
{{ if .IsNode }}
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
{{ $selected := eq $currentPage.RelPermalink .RelPermalink }}
<li class="sidebar-item-list-item {{if $selected }} sidebar-item-list-item-selected {{ end }}">
<div class="d-flex gap-1 justify-content-between align-items-center sidebar-item {{if $active }} sidebar-item-active {{ end }}">
<button class="border-0 bg-transparent d-flex align-items-center justify-content-between rounded sidebar-subcategory w-100 sidebar-item {{if not $active }} collapsed {{end}}" data-bs-toggle="collapse" data-bs-target="#section-{{ md5 .LinkTitle }}" aria-expanded="{{ if $active }}true{{ else }}false{{ end }}">
<a href="{{if $selected }}#{{ else }}{{ .Permalink }}{{ end }}" class="sidebar-item mx-0 p-0">
<span>{{ .LinkTitle }}</span>
</a>
{{ if len (where .Pages ".Params.unlisted" "!=" "true") }}
<div class="chevron-rotator">
<i class="bi bi-chevron-right {{if $active }} sidebar-icon-active {{ end }}"></i>
<div class="chevron-rotator">
{{ end }}
</button>
</div>
<div class="collapse{{ if $active }} show{{ end }}" id="section-{{ md5 .LinkTitle }}">
<ul class="btn-toggle-nav list-unstyled fw-normal small">
{{ range where .Pages ".Params.unlisted" "!=" "true" }}
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
<li class="sidebar-item-list-item {{if $active }} sidebar-item-list-item-selected {{ end }}">
<a class="sidebar-subcategory docs-link rounded {{ if $active }} sidebar-item-active active {{ end }} sidebar-item" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
</ul>
</div>
</li>
{{ else }}
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
<li class="sidebar-item-list-item {{if $active }} sidebar-item-list-item-selected {{ end }}">
<a class="sidebar-subcategory docs-link rounded {{ if $active }} sidebar-item-active active {{ end }} sidebar-item" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
{{ end }}
{{ range where .Pages ".Params.unlisted" "!=" "true" }}
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
<li class="sidebar-item-list-item {{if $active }} sidebar-item-list-item-selected {{ end }}">
<a class="sidebar-subcategory docs-link rounded {{ if $active }} sidebar-item-active active {{ end }} sidebar-item" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
</ul>
</div>
</li>
Expand Down

0 comments on commit ff4dd38

Please sign in to comment.