main
html 85 lines 5.48 KB
Raw
1 <header class="header site-header">
2 <nav class="header-nav" aria-label="Primary">
3 <a class="site-brand" href="{{ "" | absLangURL }}" accesskey="h" title="Claracle (Alt + H)" aria-label="Claracle home">
4 <span class="site-brand__mark" aria-hidden="true">
5 {{- with resources.Get "images/claracle.jpeg" }}
6 <img src="{{ .RelPermalink }}" width="32" height="32" alt="">
7 {{- end }}
8 </span>
9 <span class="site-brand__text">Claracle</span>
10 </a>
11
12 <div class="site-header__cluster">
13 {{- $currentPage := . }}
14 {{- $podcastURL := site.Params.podcast_url | default "" | strings.TrimSpace }}
15 {{- define "primary-menu-items" }}
16 {{- $currentPage := . }}
17 {{- range site.Menus.main }}
18 {{- $menuURL := .URL | relLangURL }}
19 {{- $pageURL := $currentPage.RelPermalink }}
20 {{- $isHome := eq $menuURL ("" | relLangURL) }}
21 {{- $isCurrent := or (and $isHome $currentPage.IsHome) (and (not $isHome) (or (eq $pageURL $menuURL) (strings.HasPrefix $pageURL $menuURL))) }}
22 <li>
23 <a href="{{ .URL | absLangURL }}"{{- if $isCurrent }} aria-current="page"{{- end }}>
24 {{- .Name -}}
25 </a>
26 </li>
27 {{- end }}
28 {{- end }}
29 <ul id="menu" class="menu menu--desktop">
30 {{- template "primary-menu-items" $currentPage }}
31 </ul>
32 <details class="site-menu">
33 <summary class="site-menu__toggle" aria-label="Toggle primary navigation">
34 <span class="site-menu__toggle-icon" aria-hidden="true"></span>
35 <span class="site-menu__toggle-text">Menu</span>
36 </summary>
37 <ul class="menu menu--mobile">
38 {{- template "primary-menu-items" $currentPage }}
39 </ul>
40 </details>
41
42 <div class="site-actions" aria-label="Site actions">
43 {{- with $podcastURL }}
44 <a class="icon-button spotify-button" href="{{ . | safeURL }}" target="_blank" rel="noopener noreferrer" aria-label="Spotify" title="Listen on Spotify">
45 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
46 <circle cx="12" cy="12" r="10"></circle>
47 <path d="M8 9.5c2.9-.9 5.8-.7 8.5.7"></path>
48 <path d="M8.7 12.4c2.3-.7 4.7-.5 6.8.5"></path>
49 <path d="M9.4 15.2c1.6-.4 3.2-.3 4.7.4"></path>
50 </svg>
51 </a>
52 {{- end }}
53
54 <a class="icon-button github-button" href="https://github.com/jmservera/SquadScope" target="_blank" rel="noopener" aria-label="GitHub">
55 <svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
56 <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"></path>
57 </svg>
58 </a>
59
60 {{- if (not site.Params.disableThemeToggle) }}
61 <button id="theme-toggle" class="icon-button theme-toggle" accesskey="t" title="Toggle theme (Alt + T)" aria-label="Toggle theme">
62 <svg class="moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
63 fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
64 stroke-linejoin="round" aria-hidden="true">
65 <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
66 </svg>
67 <svg class="sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
68 fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
69 stroke-linejoin="round" aria-hidden="true">
70 <circle cx="12" cy="12" r="5"></circle>
71 <line x1="12" y1="1" x2="12" y2="3"></line>
72 <line x1="12" y1="21" x2="12" y2="23"></line>
73 <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
74 <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
75 <line x1="1" y1="12" x2="3" y2="12"></line>
76 <line x1="21" y1="12" x2="23" y2="12"></line>
77 <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
78 <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
79 </svg>
80 </button>
81 {{- end }}
82 </div>
83 </div>
84 </nav>
85 </header>