forked from Bunteshaus/bunteshaus.de
small fixes
This commit is contained in:
parent
d645142f01
commit
f3ce347beb
BIN
assets/images/banner/term/kino.webp
Normal file
BIN
assets/images/banner/term/kino.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -7,33 +7,25 @@
|
||||||
{{ $good_w := "1920"}}
|
{{ $good_w := "1920"}}
|
||||||
{{ $good_h := "850"}}
|
{{ $good_h := "850"}}
|
||||||
{{ $what := "none" }}
|
{{ $what := "none" }}
|
||||||
{{ $missing := "" }}
|
|
||||||
{{ $banner := "" }}
|
|
||||||
{{ $img := "none" }}
|
{{ $img := "none" }}
|
||||||
{{ if eq .Kind "home" }}
|
{{ if eq .Kind "home" }}
|
||||||
{{ $what = "home" }}
|
{{ $what = "home" }}
|
||||||
{{ $banner = "home" }}
|
{{ else if eq .Kind "term" }}
|
||||||
{{ else if eq .Kind "page" }}
|
{{ $what = printf "term/%s" (anchorize .Title) }}
|
||||||
|
{{ else if eq .Kind "taxonomy" }}
|
||||||
|
{{ $what = .Data.Singular }}
|
||||||
|
{{ else }}
|
||||||
{{ with .File }}
|
{{ with .File }}
|
||||||
{{ $what = .File.ContentBaseName }}
|
{{ $what = .File.ContentBaseName }}
|
||||||
{{ $banner = $what }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else if or (eq .Kind "term") (eq .Kind "taxonomy") }}
|
|
||||||
{{ if (eq .Kind "taxonomy") }}
|
|
||||||
{{ $what = .Data.Singular | lower }}
|
|
||||||
{{ else }}
|
|
||||||
{{ $what = .Name | lower }}
|
|
||||||
{{ end }}
|
|
||||||
{{ $banner = string (printf "/images/banner/%s/%s*" .Kind $what) }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $missing := $banner }}
|
|
||||||
{{ $title_class := safeCSS "title" }}
|
{{ $title_class := safeCSS "title" }}
|
||||||
{{ $css := safeCSS "b" }}
|
{{ $css := safeCSS "b" }}
|
||||||
{{ if .IsHome }}
|
{{ if .IsHome }}
|
||||||
{{ $css = safeCSS "b_index" }}
|
{{ $css = safeCSS "b_index" }}
|
||||||
{{ $title_class = safeCSS "title_index" }}
|
{{ $title_class = safeCSS "title_index" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ $banner := string (printf "/images/banner/%s*" $what) }}
|
||||||
{{ if resources.GetMatch $banner }}
|
{{ if resources.GetMatch $banner }}
|
||||||
{{ $img = resources.GetMatch $banner }}
|
{{ $img = resources.GetMatch $banner }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -41,29 +33,30 @@
|
||||||
{{ if and (in .File "news/") (not (in .File "_index"))}}
|
{{ if and (in .File "news/") (not (in .File "_index"))}}
|
||||||
{{ $single = true }}
|
{{ $single = true }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if and (ne $img "none") (ne .Params.banner false) }}
|
{{ if and (ne $img "none") (ne .Params.banner false) }}
|
||||||
<div style="background-image: url({{- $img.Permalink -}})" class="banner {{ $css }}">
|
<div style="background-image: url({{- $img.Permalink -}})" class="banner {{ $css }}">
|
||||||
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
|
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
<div style="color: red;">
|
<div style="color: black;">
|
||||||
{{ $w := (resources.GetMatch $banner).Width }}
|
{{ $w := (resources.GetMatch $banner).Width }}
|
||||||
{{ $h := (resources.GetMatch $banner).Height }}
|
{{ $h := (resources.GetMatch $banner).Height }}
|
||||||
{{ if lt (int $w) $good_w }}
|
{{ if lt (int $w) $good_w }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Width: {{ $w }}px: too small, must be {{ $good_w -}}px in width<br>
|
Width: {{ $w }}px: too small, better {{ $good_w -}}px in width<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else if gt (int $w) $good_w }}
|
{{ else if gt (int $w) $good_w }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Width: {{ $w }}px: too big, must be {{ $good_w -}}px in width<br>
|
Width: {{ $w }}px: too big, better {{ $good_w -}}px in width<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if lt (int $h) $good_h }}
|
{{ if lt (int $h) $good_h }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Height: {{ $h }}px: too small, must be {{ $good_h -}}px in height<br>
|
Height: {{ $h }}px: too small, better {{ $good_h -}}px in height<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else if gt (int $h) $good_h }}
|
{{ else if gt (int $h) $good_h }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Height: {{ $h }}px: too big, must be {{ $good_h -}}px in height<br>
|
Height: {{ $h }}px: too big, better {{ $good_h -}}px in height<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,25 +67,54 @@
|
||||||
<div style="background-image:url({{- $img.Permalink -}})" class="banner {{ $css }}">
|
<div style="background-image:url({{- $img.Permalink -}})" class="banner {{ $css }}">
|
||||||
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
|
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
<div style="color: red;">
|
<div style="color: black;">
|
||||||
{{ $w := (index (.Resources.Match "banner*") 0).Width }}
|
{{ $w := (index (.Resources.Match "banner*") 0).Width }}
|
||||||
{{ $h := (index (.Resources.Match "banner*") 0).Height }}
|
{{ $h := (index (.Resources.Match "banner*") 0).Height }}
|
||||||
{{ if lt (int $w) $good_w }}
|
{{ if lt (int $w) $good_w }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Width: {{ $w }}px: too small, must be {{ $good_w -}}px in width<br>
|
Width: {{ $w }}px: too small, better {{ $good_w -}}px in width<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else if gt (int $w) $good_w }}
|
{{ else if gt (int $w) $good_w }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Width: {{ $w }}px: too big, must be {{ $good_w -}}px in width<br>
|
Width: {{ $w }}px: too big, better {{ $good_w -}}px in width<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if lt (int $h) $good_h }}
|
{{ if lt (int $h) $good_h }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Height: {{ $h }}px: too small, must be {{ $good_h -}}px in height<br>
|
Height: {{ $h }}px: too small, better {{ $good_h -}}px in height<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else if gt (int $h) $good_h }}
|
{{ else if gt (int $h) $good_h }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
Height: {{ $h }}px: too big, must be {{ $good_h -}}px in height<br>
|
Height: {{ $h }}px: too big, better {{ $good_h -}}px in height<br>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ 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;">
|
||||||
|
{{ $w := (index (.Resources.ByType "image") 0).Width }}
|
||||||
|
{{ $h := (index (.Resources.ByType "image") 0).Height }}
|
||||||
|
{{ if lt (int $w) $good_w }}
|
||||||
|
{{ if eq hugo.Environment "development" }}
|
||||||
|
Width: {{ $w }}px: too small, better {{ $good_w -}}px in width<br>
|
||||||
|
{{ end }}
|
||||||
|
{{ else if gt (int $w) $good_w }}
|
||||||
|
{{ if eq hugo.Environment "development" }}
|
||||||
|
Width: {{ $w }}px: too big, better {{ $good_w -}}px in width<br>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if lt (int $h) $good_h }}
|
||||||
|
{{ if eq hugo.Environment "development" }}
|
||||||
|
Height: {{ $h }}px: too small, better {{ $good_h -}}px in height<br>
|
||||||
|
{{ end }}
|
||||||
|
{{ else if gt (int $h) $good_h }}
|
||||||
|
{{ if eq hugo.Environment "development" }}
|
||||||
|
Height: {{ $h }}px: too big, better {{ $good_h -}}px in height<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -102,19 +124,16 @@
|
||||||
<div class="banner non_banner_height">
|
<div class="banner non_banner_height">
|
||||||
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
|
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
|
||||||
{{ if eq hugo.Environment "development" }}
|
{{ if eq hugo.Environment "development" }}
|
||||||
{{ $str1 := printf "assets%s missing.." $missing }}
|
|
||||||
{{ $str2 := "" }}
|
|
||||||
{{ with .File }}
|
|
||||||
{{ $str2 = printf "content/%sbanner* missing.." .Dir }}
|
|
||||||
{{ end }}
|
|
||||||
<p>
|
<p>
|
||||||
{{ if eq .Params.banner false }}
|
{{ if eq .Params.banner false }}
|
||||||
banner is off
|
banner is off
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ if eq $single true }}
|
{{ if eq $single true }}
|
||||||
{{ $str2 }}
|
{{ with .File }}
|
||||||
|
{{ printf "content/%sbanner* missing.." .Dir }}
|
||||||
|
{{ end }}
|
||||||
{{ else if eq $single false }}
|
{{ else if eq $single false }}
|
||||||
{{ $str1 }}
|
{{ printf "assets/images/banner/%s* missing.." $what }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user