Skip to content

Commit f02cb80

Browse files
committed
fix how li is nested in navbar
1 parent 98ebae3 commit f02cb80

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

website_and_docs/layouts/partials/navbar.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@
1010
<ul class="navbar-nav mr-4 mb-2 mb-lg-0 ps-4 ps-lg-2">
1111
{{ $p := . }}
1212
{{ range .Site.Menus.main }}
13-
<li class="nav-item mr-4 mb-2 mb-lg-0">
14-
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }}
15-
{{ with .Page }}
16-
{{ $active = or $active ( $.IsDescendant .) }}
17-
{{ end }}
18-
{{ $pre := .Pre }}
19-
{{ $post := .Post }}
20-
{{ $url := urls.Parse .URL }}
21-
{{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
22-
{{ if .HasChildren }}
13+
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }}
14+
{{ with .Page }}
15+
{{ $active = or $active ( $.IsDescendant .) }}
16+
{{ end }}
17+
{{ $pre := .Pre }}
18+
{{ $post := .Post }}
19+
{{ $url := urls.Parse .URL }}
20+
{{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
21+
{{ if .HasChildren }}
2322
<li class="nav-item dropdown">
2423
<a class="nav-link {{if $active }} active{{end}} dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2524
{{ .Name }}
@@ -31,10 +30,11 @@
3130
{{ end }}
3231
</div>
3332
</li>
34-
{{ else }}
35-
<a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with .Pre}}{{ $pre }}{{ end }}<span{{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with .Post}}{{ $post }}{{ end }}</a>
36-
{{ end }}
37-
</li>
33+
{{ else }}
34+
<li class="nav-item mr-4 mb-2 mb-lg-0">
35+
<a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with .Pre}}{{ $pre }}{{ end }}<span{{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with .Post}}{{ $post }}{{ end }}</a>
36+
</li>
37+
{{ end }}
3838
{{ end }}
3939
{{ if .Site.Params.versions }}
4040
<li class="nav-item dropdown d-none d-lg-block">

0 commit comments

Comments
 (0)