2022-05-06 11:49:30 +02:00
|
|
|
{{ $title := .Title }}
|
|
|
|
{{ $title = singularize $title }}
|
|
|
|
{{ $title = i18n $title }}
|
|
|
|
{{ if not $title }}
|
|
|
|
{{ $title = .Title }}
|
|
|
|
{{ end }}
|
2022-05-06 13:29:00 +02:00
|
|
|
|
|
|
|
{{ $what := "none" }}
|
|
|
|
{{ $img := "none" }}
|
|
|
|
{{ if eq .Kind "home" }}
|
|
|
|
{{ $what = "home" }}
|
2022-05-06 14:01:05 +02:00
|
|
|
{{ else }}
|
|
|
|
{{ with .File }}
|
|
|
|
{{ $what = .File.ContentBaseName }}
|
|
|
|
{{ end }}
|
2022-05-06 13:29:00 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ $banner := printf "/images/banner/%s*" $what }}
|
|
|
|
{{ if resources.GetMatch $banner }}
|
2022-05-09 21:37:34 +02:00
|
|
|
{{ $img = (resources.GetMatch $banner).Fill "1280x480 smart" }}
|
2022-05-06 13:29:00 +02:00
|
|
|
{{ end }}
|
2022-05-09 23:01:43 +02:00
|
|
|
{{ $height := safeCSS "min-height: 460px; max-height: 480px;" }}
|
2022-05-09 21:37:34 +02:00
|
|
|
{{ if and (resources.GetMatch $banner) (ne .Params.banner false) }}
|
2022-05-09 23:01:43 +02:00
|
|
|
{{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }}
|
|
|
|
<div style="background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url({{- $img.Permalink -}}); {{ $height }}" class="banner banner-shadow"><h1 class="dark-shadow">{{ $title }}</h1></div>
|
2022-05-09 21:37:34 +02:00
|
|
|
{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }}
|
|
|
|
{{ $img = (.Resources.GetMatch "banner*").Fill "1280x480 smart" }}
|
2022-05-09 23:01:43 +02:00
|
|
|
{{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }}
|
|
|
|
<div style="background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url({{- $img.Permalink -}}); {{ $height }}" class="banner banner-shadow"><h1 class="dark-shadow">{{ $title }}</h1></div>
|
2022-05-09 21:37:34 +02:00
|
|
|
{{ else if and (.Resources.ByType "image") (ne .Params.banner false) }}
|
|
|
|
{{ $img = (index (.Resources.ByType "image") 0).Fill "1280x480 smart" }}
|
2022-05-09 23:01:43 +02:00
|
|
|
{{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }}
|
|
|
|
<div style="background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url({{- $img.Permalink -}}); {{ $height }}" class="banner banner-shadow"><h1 class="dark-shadow">{{ $title }}</h1></div>
|
2022-05-06 13:29:00 +02:00
|
|
|
{{ else }}
|
2022-05-09 23:01:43 +02:00
|
|
|
<div style="background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)); {{ $height }}" class="banner"><h1>{{ $title }}</h1></div>
|
2022-05-06 11:49:30 +02:00
|
|
|
{{ end }}
|