1
+ {{ $cover := and
2
+ (.HasShortcode "blocks/cover")
3
+ (not .Site.Params.ui.navbar_translucent_over_cover_disable)
4
+ -}}
5
+ {{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
6
+
7
+ < nav class ="td-navbar js-navbar-scroll
8
+ {{- if $cover }} td-navbar-cover {{- end }} " data-bs-theme ="dark ">
9
+ < div class ="container-fluid flex-column flex-md-row ">
10
+ < a class ="navbar-brand " href ="{{ .Site.Home.RelPermalink }} ">
11
+ {{- /**/ -}}
12
+ < span class ="navbar-brand__logo navbar-logo ">
13
+ {{- if ne .Site.Params.ui.navbar_logo false -}}
14
+ {{ with resources.Get "icons/logo.svg" -}}
15
+ {{ ( . | minify).Content | safeHTML -}}
16
+ {{ end -}}
17
+ {{ end -}}
18
+ </ span >
19
+ {{- /**/ -}}
20
+ < span class ="navbar-brand__name ">
21
+ <!-- Place the site title on every page header, except the home page -->
22
+ {{ if not .IsHome }}
23
+ {{ .Site.Title }}
24
+ {{ end }}
25
+
26
+ </ span >
27
+ {{- /**/ -}}
28
+ </ a >
29
+ < div class ="td-navbar-nav-scroll ms-md-auto " id ="main_navbar ">
30
+ < ul class ="navbar-nav ">
31
+ {{ $p := . -}}
32
+ {{ range .Site.Menus.main -}}
33
+ < li class ="nav-item ">
34
+ {{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
35
+ {{ $href := "" -}}
36
+ {{ with .Page -}}
37
+ {{ $active = or $active ( $.IsDescendant .) -}}
38
+ {{ $href = .RelPermalink -}}
39
+ {{ else -}}
40
+ {{ $href = .URL | relLangURL -}}
41
+ {{ end -}}
42
+ {{ $isExternal := ne $baseURL.Host (urls.Parse .URL).Host -}}
43
+ < a {{ /**/ -}}
44
+ class="nav-link {{- if $active }} active {{- end }} " {{ /**/ -}}
45
+ href="{{ $href }} "
46
+ {{- if $isExternal }} target ="_blank " rel ="noopener " {{- end -}}
47
+ >
48
+ {{- .Pre -}}
49
+ < span > {{ .Name }}</ span >
50
+ {{- .Post -}}
51
+ </ a >
52
+ </ li >
53
+ {{ end -}}
54
+ {{ if .Site.Params.versions -}}
55
+ < li class ="nav-item dropdown d-none d-lg-block ">
56
+ {{ partial "navbar-version-selector.html" . -}}
57
+ </ li >
58
+ {{ end -}}
59
+ {{ if (gt (len .Site.Home.Translations) 0) -}}
60
+ < li class ="nav-item dropdown d-none d-lg-block ">
61
+ {{ partial "navbar-lang-selector.html" . -}}
62
+ </ li >
63
+ {{ end -}}
64
+ {{ if .Site.Params.ui.showLightDarkModeMenu -}}
65
+ < li class ="td-light-dark-menu nav-item dropdown ">
66
+ {{ partial "theme-toggler" . }}
67
+ </ li >
68
+ {{ end -}}
69
+ </ ul >
70
+ </ div >
71
+ < div class ="d-none d-lg-block ">
72
+ {{ partial "search-input.html" . }}
73
+ </ div >
74
+ </ div >
75
+ </ nav >
0 commit comments