small fixes

This commit is contained in:
teldra 2022-06-15 15:42:06 +02:00
parent 9af172fdc4
commit fafe85ca98
1 changed files with 9 additions and 9 deletions

View File

@ -36,9 +36,8 @@
{{ if and (ne $img "none") (ne .Params.banner false) }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner {{ $css }}">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<div style="color: black;">
<div style="color: red; background: white;">
{{ $w := (resources.GetMatch $banner).Width }}
{{ $h := (resources.GetMatch $banner).Height }}
{{ if lt (int $w) $good_w }}
@ -61,13 +60,13 @@
{{ end }}
</div>
{{ end }}
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
</div>
{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }}
{{ $img = .Resources.GetMatch "banner*" }}
<div style="background-image:url({{- $img.Permalink -}})" class="banner {{ $css }}">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<div style="color: black;">
<div style="color: red; background: white;">
{{ $w := (index (.Resources.Match "banner*") 0).Width }}
{{ $h := (index (.Resources.Match "banner*") 0).Height }}
{{ if lt (int $w) $good_w }}
@ -90,13 +89,13 @@
{{ end }}
</div>
{{ end }}
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
</div>
{{ else if and (.Resources.ByType "image") (ne .Params.banner false) (not true) }}
{{ $img = index (.Resources.ByType "image") 0 }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner {{ $css }}">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<div style="color: black;">
<div style="color: red; background: white;">
{{ $w := (index (.Resources.ByType "image") 0).Width }}
{{ $h := (index (.Resources.ByType "image") 0).Height }}
{{ if lt (int $w) $good_w }}
@ -119,12 +118,12 @@
{{ end }}
</div>
{{ end }}
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
</div>
{{ else }}
<div class="banner b altbg">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<p>
<div style="color: red; background: white;">
{{ if eq .Params.banner false }}
banner is off
{{ else }}
@ -136,7 +135,8 @@
{{ printf "assets/images/banner/%s* missing.." $what }}
{{ end }}
{{ end }}
</p>
</div>
{{ end }}
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
</div>
{{ end }}