This repository has been archived by the owner on Jan 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
/
navbar.html
49 lines (49 loc) · 1.85 KB
/
navbar.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
{{ $homeLink := .Site.Params.Homepage }}
{{ if .IsHome }}
{{ $homeLink = "/" }}
{{ end }}
<nav class="navbar" role="navigation" aria-label="main navigation">
{{ if not .Site.Params.DontShowLogo }}
<div class="navbar-start">
<div class="logo">
<a href={{ relref . $homeLink }}>
<img class="logo" src={{ .Site.Params.logo | absURL }}>
</a>
</div>
</div>
{{ end }}
<div class="navbar-middle">
<a class="a-clean" href={{ relref . $homeLink }}><p class="welcome-title">{{ .Site.Title }}</p></a>
{{ if not .IsHome }}
{{ if and .Site.Menus .Site.Menus.main }}
<div class="menu">
{{ $lastIndex := sub (len .Site.Menus.main) 1 }}
{{ $currentPage := .RelPermalink }}
{{ range $i, $el := .Site.Menus.main }}
{{ $active := "" }}
{{ if eq $el.URL $currentPage }}
{{ $active = "active" }}
{{ end }}
<a class="{{ $active }}" href="{{ $el.URL }}">{{ $el.Name }}</a>
{{ if ne $i $lastIndex }} / {{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
</div>
<div class="navbar-end">
<div class="socials">
{{ $socials := .Site.Params.socials }}
{{ if and .IsHome $socials }}
{{ $socials = where $socials "landing" true }}
{{ end }}
{{ range $el := $socials }}
<div class="social">
<a href="{{ $el.url }}" {{ if $el.rel_me }} rel="me" {{ end }} target="_blank">
<i class="{{ $el.icon }}"></i>
</a>
</div>
{{ end }}
</div>
</div>
</nav>