small fixes

This commit is contained in:
teldra 2022-06-12 17:24:42 +02:00
parent fa1c41069e
commit cb509100d5
4 changed files with 38 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 558 KiB

View File

@ -7,7 +7,6 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
background-position: top center; background-position: top center;
display: flex;
flex-direction: column; flex-direction: column;
align-content: center; align-content: center;

View File

@ -15,8 +15,7 @@
background-repeat: no-repeat; background-repeat: no-repeat;
position: relative; position: relative;
background-size: cover; background-size: cover;
min-height: 20vw; height: calc(33vh / 2.4);
max-height: 33vw;
} }
.img-only { .img-only {
width: 100%; width: 100%;

View File

@ -25,9 +25,13 @@
{{ if and (resources.GetMatch $banner) (ne .Params.banner false) }} {{ if and (resources.GetMatch $banner) (ne .Params.banner false) }}
{{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }} {{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner"> <div style="background-image: url({{- $img.Permalink -}})" class="banner">
<h1>{{ $title }}</h1>
{{ if eq hugo.Environment "development" }} {{ if eq hugo.Environment "development" }}
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
{{ end }}
<h1>{{ $title }}</h1>
{{ if eq hugo.Environment "development" }}
<div>Width: {{ (resources.GetMatch $banner).Width }}px</div> <div>Width: {{ (resources.GetMatch $banner).Width }}px</div>
<div>Height: {{ (resources.GetMatch $banner).Height }}px</div> <div>Height: {{ (resources.GetMatch $banner).Height }}px</div>
<div>Ratio: {{div (float (resources.GetMatch $banner).Width) (float (resources.GetMatch $banner).Height) }}</div> <div>Ratio: {{div (float (resources.GetMatch $banner).Width) (float (resources.GetMatch $banner).Height) }}</div>
@ -37,27 +41,42 @@
{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }} {{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }}
{{ $img = (.Resources.GetMatch "banner*").Fill $fill }} {{ $img = (.Resources.GetMatch "banner*").Fill $fill }}
{{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }} {{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }}
<div style="background-image:url({{- $img.Permalink -}})" class="banner"><h1>{{ $title }}</h1> <div style="background-image:url({{- $img.Permalink -}})" class="banner">
{{ if eq hugo.Environment "development" }} {{ if eq hugo.Environment "development" }}
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div>Width: {{ (index (.Resources.Match "banner*") 0).Width }}px</div> {{ end }}
<div>Height: {{ (index (.Resources.Match "banner*") 0).Height }}px</div>
<div>Ratio: {{div (float (index (.Resources.Match "banner*") 0).Width) (float (index (.Resources.Match "banner*") 0).Height) }}</div> <h1>{{ $title }}</h1>
</div>
{{ end }} {{ if eq hugo.Environment "development" }}
<div>Width: {{ (index (.Resources.Match "banner*") 0).Width }}px</div>
<div>Height: {{ (index (.Resources.Match "banner*") 0).Height }}px</div>
<div>Ratio: {{div (float (index (.Resources.Match "banner*") 0).Width) (float (index (.Resources.Match "banner*") 0).Height) }}</div>
</div>
{{ end }}
</div> </div>
{{ else if and (.Resources.ByType "image") (ne .Params.banner false) $all }} {{ else if and (.Resources.ByType "image") (ne .Params.banner false) $all }}
{{ $img = (index (.Resources.ByType "image") 0).Fill $fill }} {{ $img = (index (.Resources.ByType "image") 0).Fill $fill }}
{{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }} {{ $height = safeCSS (printf "height: calc(%spx - 5rem);" (string $img.Height)) }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner"><h1>{{ $title }}</h1> <div style="background-image: url({{- $img.Permalink -}})" class="banner">
{{ if eq hugo.Environment "development" }} {{ if eq hugo.Environment "development" }}
<div style="display: flex; flex-direction: column;"> <div style="display: flex; flex-direction: column;">
<div>Width: {{ (index (.Resources.ByType "image") 0).Width }}px</div> {{ end }}
<div>Height: {{ (index (.Resources.ByType "image") 0).Height }}px</div>
<div>Ratio: {{div (float (index (.Resources.ByType "image") 0).Width) (float (index (.Resources.ByType "image") 0).Height) }}</div> <h1>{{ $title }}</h1>
</div>
{{ end }} {{ if eq hugo.Environment "development" }}
<div>Width: {{ (index (.Resources.ByType "image") 0).Width }}px</div>
<div>Height: {{ (index (.Resources.ByType "image") 0).Height }}px</div>
<div>Ratio: {{div (float (index (.Resources.ByType "image") 0).Width) (float (index (.Resources.ByType "image") 0).Height) }}</div>
</div>
{{ end }}
</div> </div>
{{ else }} {{ else }}
<div class="banner"><h1>{{ $title }}</h1>{{ if eq hugo.Environment "development" }}<p>assets/images/banner/{{ $what -}}.* missing..{{ end }}</div> <div class="banner">
<h1>{{ $title }}</h1>
{{ if eq hugo.Environment "development" }}
<p>assets/images/banner/{{ $what -}}.* missing..</p>
{{ end }}
</div>
{{ end }} {{ end }}