congo/layouts/partials/header.html

62 lines
2.0 KiB
HTML

<header
class="flex justify-between py-6 font-semibold sm:items-center sm:py-10 text-neutral-900 dark:text-neutral print:hidden"
>
{{/* Site logo/title */}}
<div>
{{ if .Site.Params.Logo -}}
{{ $logo := resources.Get .Site.Params.Logo }}
{{ if $logo }}
<a href="{{ "/" | relLangURL }}">
<img
src="{{ $logo.RelPermalink }}"
width="{{ div $logo.Width 2 }}"
height="{{ div $logo.Height 2 }}"
class="max-w-[10rem] max-h-[10rem] object-scale-down object-left"
alt="{{ .Site.Title }}"
/>
</a>
{{ end }}
{{ else }}
<a
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
rel="me"
href="{{ "/" | relLangURL }}"
>{{ .Site.Title | markdownify | emojify }}</a
>
{{- end }}
{{ partial "translations.html" . }}
</div>
{{/* Main menu */}}
{{ if .Site.Menus.main }}
<nav>
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.main }}
<li
class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"
>
<a
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
href="{{ .URL }}"
title="{{ .Title }}"
>{{ .Name | markdownify | emojify }}</a
>
</li>
{{ end }}
{{ if .Site.Params.enableSearch | default false }}
<li
class="ltr:text-right rtl:text-left ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"
>
<button
id="search-button"
class="text-base hover:text-primary-600 dark:hover:text-primary-400"
title="{{ i18n "search.open_button_title" }}"
>
{{ partial "icon.html" "search" }}
</button>
</li>
{{ end }}
</ul>
</nav>
{{ end }}
</header>