dot-hugo/layouts/partials/navigation.html

40 lines
1.6 KiB
HTML
Raw Normal View History

2019-01-06 10:40:05 +00:00
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ .Site.Params.logo }}</a>
<button 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="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 text-dark" href="{{ .Site.BaseURL }}">{{ .Site.Params.home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" 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 }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link text-dark" href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
<!-- Language List -->
<ul class="list-inline text-center mb-0">
{{ range $.Site.Home.AllTranslations }}
<li class="list-inline-item"><a class="text-dark" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</div>
</nav>