feat: Avancement dans l'architecture du site
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user