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-size: cover;
background-position: top center;
display: flex;
flex-direction: column;
align-content: center;

View File

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

View File

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