<!DOCTYPE html>
<html lang="{{ $.Site.LanguageCode | default "en" }}">{{ readFile "joinus.txt" | safeHTML }}
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
    {{ if .Params.Description }}
    <meta name="description" content="{{ .Params.Description }}" />
    {{ end }}
    <meta name="viewport" content="width=device-width,minimum-scale=1">
    {{ if and (isset .Params "noindex") .Params.noindex }}
    <meta name="robots" content="noindex">
    {{ end }}
    <link href='/css/main.css' rel='stylesheet' type="text/css" />
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="icon" type="image/png" href="/favicon16.png" sizes="16x16" />
    <link rel="icon" type="image/png" href="/favicon32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="/favicon64.png" sizes="64x64" />
    <link rel="icon" type="image/png" href="/favicon128.png" sizes="128x128" />
    <link rel="canonical" href="{{ .Permalink }}">
    {{ if .IsTranslated }}
    <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" />
    {{ range .Translations }}<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" />
    {{- end }}
    {{- end }}
  </head>
  <body>
    <nav id="top-bar">
      <div class="container">
        <div class="logo">
          <a href="/" title="{{ i18n "toHomepage" }}"></a>
        </div>
        <ul class="menu">
          {{ $currentPage := . }}
          {{ range .Site.Menus.main }}
            <li><a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a></li>
          {{ end }}
        </ul>
        {{ $.Scratch.Set "nav-orientation" "" }}
        {{ partial "lang-dropdown.html" . }}
      </div>
    </nav>


    <nav class="hamburger">
      <input type="checkbox" />

      <div class="patty">
        <i></i>
        <i></i>
        <i></i>
      </div>

    <ul>
        {{ $currentPage := . }}
        {{ range .Site.Menus.main }}
          <li><a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a></li>
        {{ end }}
        <li class="fatty"></li>
        {{ if .Site.IsMultiLingual }}
        {{ $lang := .Site.Language }}
        {{ range .Site.Languages }}
        <li>
            {{ $translated := where $.Translations "Lang" .Lang }}
            {{ if $translated }}
                {{ $.Scratch.Set "url" (index $translated 0).Permalink }}
            {{ else if eq .Lang $.Page.Lang }}
                {{ $.Scratch.Set "url" $.Permalink }}
            {{ else }}
                {{ $.Scratch.Set "url" (delimit (slice "/" .) "") }}
            {{ end }}
            <a href="{{ $.Scratch.Get "url" }}" class="lang">
                {{ .LanguageName }}
            </a>
        </li>
        {{ end }}
    {{ end }}
      </ul>
    </nav>

    <article>
      <header class="{{ .Params.Color | default "blue" }}">
        <h1>{{.Title}}</h1>
        {{ with .Params.subtitle }}
        <span class="subtitle">{{.}}</span>
        {{ end }}
      </header>
      <div class="container">
        {{ block "main" . }}{{.Content}}{{ end }}
      </div>
    </article>

    <footer>
      <div class="editPage">
        <a href="{{ .Site.Params.gitEditBaseUrl }}{{ .File.Path }}" title="{{ i18n "editPage" }}">{{ i18n "editPage" }}</a>
      </div>
      <div class="center">
        <a href="{{ ref . "impressum.md" }}">{{ i18n "imprint" }}</a>
      </div>
      <div class="lang-dropdown-container">
        {{ $.Scratch.Set "nav-orientation" "up" }}
        {{ partial "lang-dropdown.html" . }}
      </div>
    </footer>
  </body>
</html>