Files
hextra_mirror/layouts/_partials/navbar-title.html
Floren Munteanu c9795867c4 refactor: extract navbar title as individual partial component (#718)
* feat: navbar title

* fix: navbar title

---------

Co-authored-by: Floren Munteanu <19806136+fmunteanu@users.noreply.github.com>
2025-07-21 20:43:21 +01:00

17 lines
1.2 KiB
HTML

{{- $logoPath := .Site.Params.navbar.logo.path | default "images/logo.svg" -}}
{{- $logoLink := .Site.Params.navbar.logo.link | default .Site.Home.RelPermalink -}}
{{- $logoWidth := .Site.Params.navbar.logo.width | default "20" -}}
{{- $logoHeight := .Site.Params.navbar.logo.height | default "20" -}}
{{- $logoDarkPath := .Site.Params.navbar.logo.dark | default $logoPath -}}
<a class="hx:flex hx:items-center hx:hover:opacity-75 hx:ltr:mr-auto hx:rtl:ml-auto" href="{{ $logoLink }}">
{{- $displayTitle := (.Site.Params.navbar.displayTitle | default true) }}
{{- if (.Site.Params.navbar.displayLogo | default true) }}
<img class="hx:mr-2 hx:block hx:dark:hidden" src="{{ $logoPath | relURL }}" alt="{{ cond $displayTitle `Logo` .Site.Title }}" height="{{ $logoHeight }}" width="{{ $logoWidth }}" />
<img class="hx:mr-2 hx:hidden hx:dark:block" src="{{ $logoDarkPath | relURL }}" alt="{{ cond $displayTitle `Dark Logo` .Site.Title }}" height="{{ $logoHeight }}" width="{{ $logoWidth }}" />
{{- end }}
{{- if $displayTitle }}
<span class="hx:mr-2 hx:font-extrabold hx:inline hx:select-none" title="{{ .Site.Title }}">{{- .Site.Title -}}</span>
{{- end }}
</a>