feat: Avancement dans l'architecture du site

This commit is contained in:
2020-11-23 11:31:02 +01:00
parent f1fcafd47b
commit 2ff814cd9b
47 changed files with 536 additions and 227 deletions

View File

@ -1,15 +1,16 @@
{{ $imageSize := cond .IsHome "1920x850 Top" "1920x450 Center" }}
<header class="header{{ if .IsHome }} home{{ end }}">
{{ if .Resources }}
{{ if .Resources.ByType "image" }}
{{ $image := .Resources.GetMatch (default "*" .Params.image) }}
{{ if $image }}
{{ $resized := $image.Fill "1400x600 Center"}}
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
{{ $resized := $image.Fill $imageSize }}
<img class="hero" src="{{ $resized.RelPermalink }}" />
{{ end }}
{{ else }}
{{ $headless := .Site.GetPage "/" }}
{{ $image := $headless.Resources.GetMatch "*" }}
{{ $resized := $image.Fill "1400x600 Top"}}
<img class="hero" src="{{ $resized.RelPermalink }}" alt="{{ .Title }}" />
{{ $resized := $image.Fill $imageSize }}
<img class="hero" src="{{ $resized.RelPermalink }}" />
{{ end }}
<nav class="nav">
<div class="container">
@ -21,11 +22,20 @@
<button class="open-button">≡ Menu</button>
<ol id="menu">
{{ range .Site.Menus.main }}
<li>
<li class="menu{{ if .HasChildren }} withSubmenu{{ end }}">
<a href="{{ .URL }}">
<img class="icons" src="/icons/{{ .Identifier }}.svg" alt="{{ .Name }}" />
<span>{{ .Name }}</span>
</a>
{{ if .HasChildren }}
<ol class="submenu">
{{ range .Children }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ol>
{{ end }}
</li>
{{ end }}
</ol>