congo/layouts/partials/logo.html

46 lines
1.6 KiB
HTML
Raw Normal View History

2022-11-10 00:32:43 +00:00
{{- if .Site.Params.header.logo }}
{{- $logo := resources.Get .Site.Params.header.logo }}
2023-04-13 07:57:46 +00:00
{{- $darkLogo := resources.Get .Site.Params.header.darkLogo }}
<!-- If both logos are present, show different logo accordingly -->
{{- if and $logo $darkLogo }}
<a href="{{ "" | relLangURL }}" class="inline mr-2 dark:hidden">
<img
src="{{ $logo.RelPermalink }}"
width="{{ div $logo.Width 2 }}"
height="{{ div $logo.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left"
alt="{{ .Site.Title }}"
/>
</a>
<a href="{{ "" | relLangURL }}" class="hidden mr-2 dark:inline">
<img
src="{{ $darkLogo.RelPermalink }}"
width="{{ div $darkLogo.Width 2 }}"
height="{{ div $darkLogo.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left"
alt="{{ .Site.Title }}"
/>
</a>
<!-- Else if the standard logo is present, show the logo -->
{{- else if $logo }}
2022-11-10 00:32:43 +00:00
<a href="{{ "" | relLangURL }}" class="mr-2">
<img
src="{{ $logo.RelPermalink }}"
width="{{ div $logo.Width 2 }}"
height="{{ div $logo.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left"
alt="{{ .Site.Title }}"
/>
</a>
2022-11-10 00:32:43 +00:00
{{- end }}
{{- end }}
{{- if .Site.Params.header.showTitle | default true }}
<a
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
rel="me"
href="{{ "" | relLangURL }}"
>{{ .Site.Title | markdownify | emojify }}</a
>
{{- end }}