aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/nav.html
blob: 0aa02ff0f0e74591fcc0d8919aded503e5e01b4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<p class="nocss-helper"></p>
<nav>
  <div class="navbar">
    <a class="navbar__link navbar__link--title" href="/{{ .Lang }}">{{ .Site.Params.AuthorName }}</a>

    <input id="hamburger" type="checkbox" hidden />
    <label for="hamburger" class="navbar__menu-btn navbar__link" aria-controls="navbar__menu" hidden>
      {{ i18n "nav_menu" }}
    </label>

    <div id="navbar__menu">
      <span class="navbar__links">
        <a class="navbar__link" href="{{ relref . "projects.md" }}">{{ i18n "nav_projects" }}</a>
        <a class="navbar__link" href="{{ relref . "accounts.md" }}">{{ i18n "nav_accounts" }}</a>
        <a class="navbar__link" href="{{ relref . "about.md" }}">{{ i18n "nav_about" }}</a>
      </span>
      <span class="navbar__links">
        <a class="navbar__link mr-0" href="https://git.dawidpotocki.com/dawid/dawidpotocki.com/">
          {{ i18n "nav_source" }}
        </a>

        <span class="navbar__divider"></span>
        <div> <!-- this div is for text browsers -->
          <details class="dropdown navbar__link">
            <summary>
              {{- if eq .Lang "en" }}
              {{- partial "flag.html" (dict "code" "gb" "alt" .Language.LanguageName) }}
              {{- else }}
              {{- partial "flag.html" (dict "code" .Lang "alt" .Language.LanguageName) }}
              {{- end }}
            </summary>
            <span class="dropdown__popup">
              {{- if .IsTranslated }}
              {{- range .Translations }}
              <a class="dropdown__item" href="{{ .RelPermalink }}" hreflang="{{ .Lang }}">
                {{- if eq .Lang "en" }}
                {{- partial "flag.html" (dict "code" "gb" "text" .Language.LanguageName) }}
                {{- else }}
                {{- partial "flag.html" (dict "code" .Lang "text" .Language.LanguageName) }}
                {{- end }}
              </a>
              {{- end }}
              {{- end }}
            </span>
          </details>
        </div>
      </span>
    </div>
  </div>
</nav>
<hr class="nocss-helper" />