cremeaux/layouts/partials/header.html

36 lines
1.2 KiB
HTML
Raw Normal View History

2020-11-09 12:36:28 +01:00
<header class="header{{ if .IsHome }} home{{ end }}">
{{ if .Resources }}
{{ $image := .Resources.GetMatch (default "*" .Params.image) }}
{{ if $image }}
{{ $resized := $image.Fill "1400x600 Center"}}
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
{{ end }}
{{ else }}
{{ $headless := .Site.GetPage "/" }}
{{ $image := $headless.Resources.GetMatch "*" }}
{{ $resized := $image.Fill "1400x600 Top"}}
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
{{ end }}
2020-11-04 23:45:35 +01:00
<nav class="nav">
2020-11-05 14:14:55 +01:00
<div class="container">
<div class="logo">
2020-10-21 16:23:05 +02:00
<a href="/" class="">
2020-11-09 12:36:28 +01:00
<img src="/icons/logo-header.png" alt="Blason de Crémeaux" />
2020-10-21 16:23:05 +02:00
</a>
2020-11-05 14:14:55 +01:00
</div>
<button class="open-button">≡ Menu</button>
<ol id="menu">
{{ range .Site.Menus.main }}
<li>
<a href="{{ .URL }}">
2020-11-09 12:36:28 +01:00
<img class="icons" src="/icons/{{ .Identifier }}.svg" alt="{{ .Name }}" />
2020-11-05 14:14:55 +01:00
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
</ol>
<button class="close-button">✖ Fermer</button>
</div>
2020-11-04 23:45:35 +01:00
</nav>
</header>