2021-01-19 23:52:52 +01:00
|
|
|
{{ $isBig := (default .IsHome .Params.big) }}
|
2021-05-03 14:57:56 +02:00
|
|
|
{{ $imageSizeSmall := cond $isBig "600x600 Top webp" "600x400 Center webp" }}
|
|
|
|
{{ $imageSizeBig := cond $isBig "1920x850 Top webp" "1920x450 Center webp" }}
|
2021-01-19 23:52:52 +01:00
|
|
|
<header class="header{{ if $isBig }} home{{ end }}">
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ $headless := .Site.GetPage "/" }}
|
2021-04-08 17:27:37 +02:00
|
|
|
{{ $image := default ($headless.Resources.GetMatch "**.jpg") (.Resources.GetMatch (default "**.jpg" .Params.image)) }}
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ if $image }}
|
|
|
|
{{ $resizedSmall := $image.Fill $imageSizeSmall }}
|
|
|
|
{{ $resizedBig := $image.Fill $imageSizeBig }}
|
2020-12-09 17:23:27 +01:00
|
|
|
<img
|
|
|
|
class="hero no-print"
|
|
|
|
src="{{ $resizedSmall.RelPermalink }}"
|
|
|
|
srcset="{{ $resizedSmall.RelPermalink }} 600w, {{ $resizedBig.RelPermalink }} 1920w"
|
|
|
|
sizes="(max-width: 600px) 500px, 1920px"
|
2023-02-22 14:23:23 +01:00
|
|
|
alt="{{ or .Params.image_ .Params.image_credit }}"
|
|
|
|
title="{{ or .Params.image_ .Params.image_credit }}"
|
2020-12-09 17:23:27 +01:00
|
|
|
/>
|
2020-11-09 12:36:28 +01:00
|
|
|
{{ end }}
|
2020-12-20 00:59:40 +01:00
|
|
|
<nav class="nav" id="nav" data-open="false">
|
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-25 18:00:03 +01:00
|
|
|
<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>
|
2020-12-20 00:59:40 +01:00
|
|
|
<button class="open-button" onClick="document.getElementById('nav').setAttribute('data-open', true)">≡ Menu</button>
|
2020-11-05 14:14:55 +01:00
|
|
|
<ol id="menu">
|
|
|
|
{{ range .Site.Menus.main }}
|
2023-06-05 16:16:20 +02:00
|
|
|
<li class="menu{{ if .HasChildren }} withSubmenu{{ end }} {{ .Identifier }}">
|
2020-11-05 14:14:55 +01:00
|
|
|
<a href="{{ .URL }}">
|
2021-05-03 16:32:44 +02:00
|
|
|
<img class="icons" src="/icons/{{ .Identifier }}.svg" alt="{{ .Name }}" width="30" height="30" /><span>{{ .Name }}</span>
|
2020-11-05 14:14:55 +01:00
|
|
|
</a>
|
2020-11-23 11:31:02 +01:00
|
|
|
{{ 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>
|
2020-12-20 00:59:40 +01:00
|
|
|
<button class="close-button" onClick="document.getElementById('nav').setAttribute('data-open', false)">✖ Fermer</button>
|
2020-11-05 14:14:55 +01:00
|
|
|
</div>
|
2020-11-04 23:45:35 +01:00
|
|
|
</nav>
|
|
|
|
</header>
|