hugo-coder-fork/layouts/partials/header.html

43 lines
1.5 KiB
HTML
Raw Normal View History

2018-03-01 01:38:59 +00:00
<nav class="navigation">
<section class="container">
<a class="navigation-title" href="{{ .Site.BaseURL | relLangURL }}">
2018-03-01 01:38:59 +00:00
{{ .Site.Title }}
</a>
{{ if or .Site.Menus.main .Site.IsMultiLingual }}
<span class="primary-menu-item">
{{ with index $.Site.Menus.main 0 }}
<a class="navigation-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
{{ end }}
</span>
<input type="checkbox" id="menu-toggle" />
2020-02-21 14:42:31 +00:00
<label class="menu-button float-right" for="menu-toggle">{{ partial "svg/hamburger.svg" }}</label>
<ul class="navigation-list">
{{ with .Site.Menus.main}}
{{ range sort . }}
<li class="navigation-item">
<a class="navigation-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
</li>
2018-07-08 23:12:36 +00:00
{{ end }}
{{ end }}
{{ if .Site.IsMultiLingual }}
{{ $node := . }}
{{ .Scratch.Set "separator" true }}
{{ range .Site.Home.AllTranslations }}
{{ if ne $.Site.Language .Language }}
{{ if $node.Scratch.Get "separator" }}
<li class="navigation-item menu-separator">
<span>|</span>
2018-07-08 23:12:36 +00:00
</li>
{{ $node.Scratch.Set "separator" false }}
2018-07-08 23:12:36 +00:00
{{ end }}
<li class="navigation-item">
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
2018-07-08 23:12:36 +00:00
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ end }}
2018-03-01 01:38:59 +00:00
</section>
</nav>