-
Notifications
You must be signed in to change notification settings - Fork 49
/
navigation.html
95 lines (90 loc) · 3.93 KB
/
navigation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<nav class="navbar navbar-expand-md navbar-dark d-flex flex-column p-0" style=" {{ if .IsHome }}background-color: transparent{{ else }}background-color: {{ site.Params.primary_color }}{{ end }}">
<div class="w-100 container mx-0 navigation-bar">
<div id="site-brand">
{{ $logo:= site.Params.logo }}
{{ $orgName:= site.Params.brand.parent_org_name }}
{{ $orgUrl:= site.Params.brand.parent_org_url }}
<div class="navbar-brand">
{{ if $logo }}
<img class="img-fluid d-inline globalLogoImg"
src="{{ $logo | absURL }}"
alt="{{ site.Title }}">
{{ end }}
<a class="text-center text-white d-block px-1" href="{{ site.BaseURL | relLangURL }}">{{ site.Title }}</a>
</div>
</div>
<a class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#navigation"
aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
<span class="sidebarIcon navbarMenu">Menu<i class="fa-solid fa-caret-down d-inline p-1"></i>
</span>
</a>
<div class="collapse navbar-collapse text-center" id="navigation">
<ul class="navbar-nav ml-auto">
{{ range site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-white" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{{ .Name }}
</a>
<div class="dropdown-menu">
{{ range .Children }}
<a class="dropdown-item" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link text-white" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
<!-- Language List -->
{{- if site.IsMultiLingual }}
<select class="lang-list bg-primary {{ if not .IsHome }}mb-3 mb-md-0{{ end }}" id="select-language"
onchange="location = this.value;">
{{ $siteLanguages := site.Languages}}
{{ $pageLang := .Page.Lang}}
{{ range .Page.AllTranslations }}
{{ $translation := .}}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ $selected := false }}
{{ if eq $pageLang .Lang}}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
</option>
{{ else }}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</select>
{{ end }}
<p class="text-white unicef-glob ml-4 mt-3">Visit <a href="{{ $orgUrl }}" class="text-white">{{ $orgName }} <i
class="fas fa-angle-double-right"></i></a></p>
</div>
</div>
{{ if not .IsHome }}
<div class="w-100 py-2 breadcrumbBar text-light" style=" {{ if .IsHome }}background-color: transparent{{ else }}background-color: {{ site.Params.text_color_dark }}{{ end }}">
<div class="container">
{{ partial "breadcrumb.html" . }}
<a data-toggle="collapse" data-target="#sidebarMobile" aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation"> <i class="ti-menu text-light sidebarIcon"></i></a>
<div class="text-light text-center sidebarMobile collapse justify-content-center" id="sidebarMobile">
<div class="sidebarBox">
<ul>
{{ $currentNode := . }}
{{range .Site.Home.Sections.ByWeight}}
{{ if eq .FirstSection $currentNode.FirstSection }}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "index" 0}}
{{ end }}
{{ end }}
{{ partial "download-pdf.html" .}}
</ul>
</div>
</div>
</div>
</div>
{{ end }}
</nav>