cach-radio/inc/themes/castanet/layouts/partials/header.html

84 lines
4.4 KiB
HTML
Raw Permalink Normal View History

2022-12-15 22:36:40 +01:00
<nav class="navbar fixed-top navbar-expand-md navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbarSupportedContent" class="navbar-collapse collapse">
<ul class="navbar-nav mr-auto">
{{ $currentPage := . }}
{{ if gt (len .Site.Menus) 0 }}
{{ range sort .Site.Menus.main "Identifier"}}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{{ .Name }}</a>
<div class="dropdown-menu">
{{ range sort .Children "Identifier"}}
<a class="dropdown-item{{ if $currentPage.IsMenuCurrent "Main" . }} active {{ end }}" href="{{ .URL | absURL}}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class= "nav-item {{ if or ($currentPage.IsMenuCurrent "Main" .) ($currentPage.HasMenuCurrent "Main" .) }} active {{ end }}">
<a href="{{ .URL | absURL }}" class="nav-link">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
{{ end }}
{{end}}
</ul>
<ul class="navbar-nav ml-auto">
{{ if (isset .Site.Params.social "facebook" ) }}
<li class>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.facebook "aclass" "social-links" "iclass" "fab fa-facebook-square fa-2x" "prefix" "https://www.facebook.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "twitter" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.twitter "aclass" "social-links" "iclass" "fab fa-twitter-square fa-2x" "prefix" "https://twitter.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "youtube" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.youtube "aclass" "social-links" "iclass" "fab fa-youtube-square fa-2x" "prefix" "https://youtube.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "pinterest" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.pinterest "aclass" "social-links" "iclass" "fab fa-pinterest-square fa-2x" "prefix" "https://www.pinterest.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "instagram" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.instagram "aclass" "social-links" "iclass" "fab fa-instagram fa-2x" "prefix" "https://www.instagram.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "linkedin" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.linkedin "aclass" "social-links" "iclass" "fab fa-linkedin fa-2x" "prefix" "https://www.linkedin.com/in/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "github" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.github "aclass" "social-links" "iclass" "fab fa-github-square fa-2x" "prefix" "https://github.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "gitlab" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.gitlab "aclass" "social-links" "iclass" "fab fa-gitlab fa-2x" "prefix" "https://gitlab.com/" "text" "") }}
</li>
{{ end }}
{{ if (isset .Site.Params.social "twitch" ) }}
<li>
{{ partial "social-link.html" (dict "context" $.Site.Params.social.twitch "aclass" "social-links" "iclass" "fab fa-twitch fa-2x" "prefix" "https://twitch.tv/" "text" "") }}
</li>
{{ end }}
</ul>
</div>
</div>
</nav>