Personal-Site/layouts/partials/navbar.html
2018-06-12 21:21:08 -07:00

48 lines
1.5 KiB
HTML

<nav id="topnav" class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container">
<a class="navbar-brand" href="/">{{ .Site.Title }}</a>
<button class="navbar-toggler mr-0 ml-auto" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li class="nav-item {{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}">
<a class="nav-link" href="{{ .URL }}">{{.Title}}</a>
</li>
{{ end }}
</ul>
<ul id="social-menu" class="navbar-nav">
{{ with .Site.Data.social }}
{{ with .github }}
<li class="nav-item">
<a class="nav-link" href="{{ . }}" target="_blank" title="GitHub">
<span class="fab fa-github-alt"></span>
</a>
</li>
{{ end }}
{{ with .linkedin }}
<li class="nav-item">
<a class="nav-link" href="{{ . }}" target="_blank" title="LinkedIn">
<span class="fab fa-linkedin"></span>
</a>
</li>
{{ end }}
{{ end }}
<li class="nav-item ml-auto">
<button id="btnTheme" type="button" class="btn btn-dark" aria-pressed="false" autocomplete="off">
<span id="themeText" class="fas fa-moon"></span>
</button>
</li>
</ul>
</div>
</div>
</nav>