-
Notifications
You must be signed in to change notification settings - Fork 313
/
header.html
executable file
·89 lines (87 loc) · 3.74 KB
/
header.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
<!-- header -->
<header class="fixed-top header">
<!-- top header -->
{{ if .Site.Params.top_header }}
<div class="top-header py-2 bg-white">
<div class="container">
<div class="row no-gutters align-items-center">
<div class="col-lg-4 text-center text-lg-left">
<ul class="list-inline">
{{ range .Site.Params.social }}
<li class="list-inline-item mx-0"><a class="d-inline-block p-2 text-color" href="{{ .link | safeURL }}"><i class="{{ .icon }}"></i></a></li>
{{ end }}
</ul>
</div>
<div class="col-lg-8 text-center text-lg-right">
<ul class="list-inline">
<li class="list-inline-item">
<a class="text-color mr-3" href="tel:{{ .Site.Params.mobile }}"><strong>{{ i18n "call" | upper }} : </strong> {{ .Site.Params.mobile }}</a></li>
<li class="list-inline-item">
<a class="text-color" href="mailto:{{ .Site.Params.email }}"><strong>{{ i18n "email" | upper }} : </strong> {{ .Site.Params.email }}</a></li>
</ul>
</div>
</div>
</div>
</div>
{{ end }}
<!-- navbar -->
<div class="navigation w-100 {{ if .Site.Params.top_header }} top-hider {{ end }}">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light p-0">
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}"><img class="img-fluid"
src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}"></a>
<button class="navbar-toggler rounded-0" type="button" data-toggle="collapse" data-target="#navigation"
aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-center" id="navigation">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.Home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown">
{{ .Name }}
</a>
<div class="dropdown-menu">
{{ range .Children }}
<a class="dropdown-item" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
<!-- Language List -->
{{ if .IsTranslated }}
<select class="m-2 border-0" 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 }}
</div>
</nav>
</div>
</div>
</header>
<!-- /header -->