cremeaux/layouts/partials/header.html

41 lines
1.6 KiB
HTML
Raw Normal View History

{{ $imageSizeSmall := cond .IsHome "600x600 Top" "600x400 Center" }}
{{ $imageSizeBig := cond .IsHome "1920x850 Top" "1920x450 Center" }}
2020-11-09 12:36:28 +01:00
<header class="header{{ if .IsHome }} home{{ end }}">
{{ $headless := .Site.GetPage "/" }}
{{ $image := default ($headless.Resources.GetMatch "*") (.Resources.GetMatch (default "*" .Params.image)) }}
{{ if $image }}
{{ $resizedSmall := $image.Fill $imageSizeSmall }}
{{ $resizedBig := $image.Fill $imageSizeBig }}
<img class="hero no-print" src="{{ $resizedSmall.RelPermalink }}" srcset="{{ $resizedSmall.RelPermalink }} 600w, {{ $resizedBig.RelPermalink }} 1920w" sizes="(max-width: 600px) 500px, 1920px" />
2020-11-09 12:36:28 +01:00
{{ 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="">
<img src="/icons/logo-entete-200x70.svg" 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 class="menu{{ if .HasChildren }} withSubmenu{{ end }}">
2020-11-05 14:14:55 +01:00
<a href="{{ .URL }}">
2020-11-26 22:02:41 +01:00
<img class="icons" src="/icons/{{ .Identifier }}.svg" alt="{{ .Name }}" /><span>{{ .Name }}</span>
2020-11-05 14:14:55 +01:00
</a>
{{ if .HasChildren }}
<ol class="submenu">
{{ range .Children }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ol>
{{ end }}
2020-11-05 14:14:55 +01:00
</li>
{{ end }}
</ol>
<button class="close-button">✖ Fermer</button>
</div>
2020-11-04 23:45:35 +01:00
</nav>
</header>