Files
fundor333.com/themes/fugu/layouts/partials/header.html
2024-07-26 02:14:33 +02:00

85 lines
2.7 KiB
HTML

<nav class='p-3'>
<div class="d-flex flex-column">
<a class="u-url navbar-brand text-center" rel=" me" href="{{ .Site.BaseURL }}">
{{/* Just modified a bit to work with render_image hook and output webp images */}}
{{/* get file that matches the filename as specified as src="" */}}
{{ $src := resources.Get .Site.Params.logo }}
{{ if $src }}
{{ $tinyw := default "500x webp" }}
{{ $smallw := default "800x webp" }}
{{ $mediumw := default "1200x webp" }}
{{ $largew := default "1500x webp" }}
{{ $data := newScratch }}
{{ $data.Set "tiny" ($src.Resize $tinyw) }}
{{ $data.Set "small" ($src.Resize $smallw) }}
{{ $data.Set "medium" ($src.Resize $mediumw) }}
{{ $data.Set "large" ($src.Resize $largew) }}
{{ $tiny := $data.Get "tiny" }}
{{ $small := $data.Get "small" }}
{{ $medium := $data.Get "medium" }}
{{ $large := $data.Get "large" }}
<picture alt="{{ .Site.Title }}" class=" h-card rounded img-fluid u-logo lazy shadow-lg bg-body-tertiary col-1" loading="lazy">
<source media="(max-width: 376px)"
srcset="{{with $tiny.RelPermalink }}{{.}}{{ end }}">
<source media="(max-width: 992px)"
srcset="{{with $small.RelPermalink }}{{.}}{{ end }}">
<source media="(max-width: 1400px)"
srcset="{{with $medium.RelPermalink }}{{.}}{{ end }}">
<source media="(min-width: 1600px)"
srcset="{{with $large.RelPermalink }}{{.}}{{ end }}">
<img alt="{{ .Site.Title }}" title="{{ .Site.Title }}" src="{{ $src }}"
height="{{ $src.Height}}" width="{{ $src.Width }}" class=" h-card rounded img-fluid u-logo lazy shadow-lg bg-body-tertiary col-1">
</picture>
{{/* Since I do image-response class, the only thing that really
matters is the height and width matches the image aspect ratio */}}
{{ end }}
</a>
</div>
<div class='d-flex flex-column '>
<div class="d-flex text-center">
<div class="col-10 offset-1">
<a class="u-url col" rel="me" href="{{ .Site.BaseURL }}">
<h1 class="p-name">
<nobr>{{ .Site.Title }}</nobr> <i class="fas fa-badge-check fa-2xs theme-fundor333"></i>
</h1>
</a>
<h5 class="text-f333">{{ .Site.Params.subtitle }}</h5>
{{ range .Site.Menus.main }}
<a class="btn col-4 col-sm-2 u-url" href="{{ .URL }}" title="{{ .Name }}">
<nobr>{{ .Name }}</nobr>
</a>
</li>
{{ end }}
<a class="btn col-4 col-sm-2 u-url" href="/search/" title="search">
<i class="fa-solid fa-magnifying-glass"></i>
</a>
</div>
</div>
</div>
</div>
</div>
</nav>
{{- partial "macia-indiweb/authentication.html" . -}}