2022-08-18 04:59:46 +00:00
|
|
|
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral print:hidden sm:py-10">
|
2022-11-10 00:32:43 +00:00
|
|
|
<nav class="flex items-start justify-between sm:items-center">
|
2022-06-27 02:31:15 +00:00
|
|
|
{{/* Site logo/title */}}
|
2022-11-10 00:32:43 +00:00
|
|
|
<div class="flex flex-row items-center">
|
2022-11-07 04:54:21 +00:00
|
|
|
{{ partial "logo.html" . }}
|
2022-06-27 02:31:15 +00:00
|
|
|
{{ partial "translations.html" . }}
|
|
|
|
</div>
|
|
|
|
{{/* Main menu */}}
|
|
|
|
{{ if or .Site.Menus.main (.Site.Params.enableSearch | default false) }}
|
2023-01-16 03:21:03 +00:00
|
|
|
<ul class="flex flex-col list-none ltr:text-right rtl:text-left sm:flex-row">
|
2022-06-27 02:31:15 +00:00
|
|
|
{{ if .Site.Menus.main }}
|
|
|
|
{{ range .Site.Menus.main }}
|
2023-01-16 03:21:03 +00:00
|
|
|
<li
|
|
|
|
class="mb-1 group sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"
|
|
|
|
>
|
|
|
|
{{ if eq .Params.action "search" }}
|
2023-01-17 01:58:04 +00:00
|
|
|
{{ $.Scratch.Add "searchCount" 1 }}
|
2023-01-16 03:21:03 +00:00
|
|
|
{{ if $.Site.Params.enableSearch | default false }}
|
|
|
|
<button
|
2023-01-17 01:58:04 +00:00
|
|
|
id="search-button-{{ $.Scratch.Get "searchCount" }}"
|
2023-01-16 03:21:03 +00:00
|
|
|
title="{{ .Title | default (i18n "search.open_button_title") }}"
|
|
|
|
>
|
2023-01-17 01:58:04 +00:00
|
|
|
{{ with .Params.icon | default "search" }}
|
2023-01-16 03:21:03 +00:00
|
|
|
<span
|
|
|
|
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600"
|
|
|
|
>
|
|
|
|
{{ partial "icon.html" . }}
|
|
|
|
</span>
|
|
|
|
{{ end }}{{ if .Params.showName | default true }}
|
|
|
|
<span
|
|
|
|
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
|
|
|
>{{ .Name | markdownify | emojify }}</span
|
|
|
|
>
|
|
|
|
{{ end }}
|
|
|
|
</button>
|
|
|
|
{{ end }}
|
2023-01-17 01:58:04 +00:00
|
|
|
{{ else if eq .Params.action "appearance" }}
|
|
|
|
{{ $.Scratch.Add "switchCount" 1 }}
|
|
|
|
<button
|
|
|
|
id="appearance-switcher-{{ $.Scratch.Get "switchCount" }}"
|
|
|
|
type="button"
|
|
|
|
aria-label="appearance switcher"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="inline transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600 dark:hidden"
|
|
|
|
title="{{ i18n "footer.dark_appearance" }}"
|
|
|
|
>
|
|
|
|
{{ with .Params.icon | default "moon" }}
|
|
|
|
{{ partial "icon.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Params.showName | default true }}
|
|
|
|
<span
|
|
|
|
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
|
|
|
>{{ .Name | markdownify | emojify }}</span
|
|
|
|
>
|
|
|
|
{{ end }}
|
|
|
|
</span>
|
|
|
|
<span
|
|
|
|
class="hidden transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600 dark:inline"
|
|
|
|
title="{{ i18n "footer.light_appearance" }}"
|
|
|
|
>
|
|
|
|
{{ with .Params.icon | default "sun" }}
|
|
|
|
{{ partial "icon.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Params.showName | default true }}
|
|
|
|
<span
|
|
|
|
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
|
|
|
>{{ .Name | markdownify | emojify }}</span
|
|
|
|
>
|
|
|
|
{{ end }}
|
|
|
|
</span>
|
|
|
|
</button>
|
2023-01-16 03:21:03 +00:00
|
|
|
{{ else }}
|
|
|
|
<a
|
|
|
|
href="{{ .URL }}"
|
|
|
|
title="{{ .Title }}"
|
|
|
|
{{ with .Params.target }}target="{{ . }}"{{ end }}
|
|
|
|
>{{ with .Params.icon }}
|
|
|
|
<span
|
|
|
|
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600"
|
|
|
|
>
|
|
|
|
{{ partial "icon.html" . }}
|
|
|
|
</span>
|
|
|
|
{{ end }}{{ if .Params.showName | default true }}
|
|
|
|
<span
|
|
|
|
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
|
|
|
>{{ .Name | markdownify | emojify }}</span
|
|
|
|
>
|
|
|
|
{{ end }}</a
|
|
|
|
>
|
|
|
|
{{ end }}
|
2022-06-27 02:31:15 +00:00
|
|
|
</li>
|
|
|
|
{{ end }}
|
2023-01-17 01:58:04 +00:00
|
|
|
{{ if and ($.Site.Params.enableSearch | default false) (eq ($.Scratch.Get "searchCount") 0) }}
|
2023-01-16 03:21:03 +00:00
|
|
|
<li
|
|
|
|
class="mb-1 group sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"
|
2022-06-27 02:31:15 +00:00
|
|
|
>
|
2023-01-16 03:21:03 +00:00
|
|
|
<button id="search-button-m0" title="{{ i18n "search.open_button_title" }}">
|
|
|
|
<span
|
|
|
|
class="transition-colors group-dark:hover:text-primary-400 group-hover:text-primary-600"
|
|
|
|
>
|
|
|
|
{{ partial "icon.html" "search" }}
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
{{ end }}
|
2022-06-27 02:31:15 +00:00
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
{{ end }}
|
|
|
|
</nav>
|
|
|
|
</header>
|