small fixes

This commit is contained in:
teldra 2022-05-09 23:06:48 +02:00
parent 1199306d16
commit 96fda4132a

View File

@ -16,18 +16,18 @@
{{ end }}
{{ $banner := printf "/images/banner/%s*" $what }}
{{ if resources.GetMatch $banner }}
{{ $img = (resources.GetMatch $banner).Fill "1280x480 smart" }}
{{ $img = (resources.GetMatch $banner).Fill "1280x320 smart" }}
{{ end }}
{{ $height := safeCSS "min-height: 460px; max-height: 480px;" }}
{{ $height := safeCSS "min-height: calc(320px - 5rem); max-height: calc(320px - 5rem);" }}
{{ if and (resources.GetMatch $banner) (ne .Params.banner false) }}
{{ $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>
{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }}
{{ $img = (.Resources.GetMatch "banner*").Fill "1280x480 smart" }}
{{ $img = (.Resources.GetMatch "banner*").Fill "1280x320 smart" }}
{{ $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>
{{ else if and (.Resources.ByType "image") (ne .Params.banner false) }}
{{ $img = (index (.Resources.ByType "image") 0).Fill "1280x480 smart" }}
{{ $img = (index (.Resources.ByType "image") 0).Fill "1280x320 smart" }}
{{ $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>
{{ else }}