hugo-stanley/layouts/partials/header.html

32 lines
1.4 KiB
HTML
Raw Permalink Normal View History

2020-03-03 18:56:59 +01:00
{{- $nav := site.Params.nav -}}
{{- if or $nav.showCategories $nav.showTags $nav.custom -}}
<div class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{- .Site.BaseURL -}}">{{- .Site.Title -}}</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
{{- if $nav.showCategories -}}
<li><a class="nav item" href="{{- `/categories/` | relLangURL -}}">{{- T "Categories" -}}</a></li>
{{- end -}}
{{- if $nav.showTags -}}
<li><a class="nav item" href="{{- `/tags/` | relLangURL -}}">{{- T "Tags" -}}</a></li>
{{- end -}}
{{- range $nav.custom -}}
{{- $url := .url | safeURL -}}
{{- if strings.HasPrefix $url "/" -}}{{- $url = $url | relLangURL -}}{{- end -}}
<li><a class="nav item" href="{{- $url -}}"{{- if strings.HasPrefix $url "http" -}} target="_blank"{{- end -}}>{{- .title -}}</a></li>
{{- end -}}
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
{{- end -}}