diff --git a/themes/buha/assets/scss/banner.scss b/themes/buha/assets/scss/banner.scss
index a73c09a..f50a8d6 100644
--- a/themes/buha/assets/scss/banner.scss
+++ b/themes/buha/assets/scss/banner.scss
@@ -66,7 +66,7 @@
}
.black {
- color: black;
+ color: var(--text-main);
}
.left {
diff --git a/themes/buha/layouts/partials/layout/gen_list.html b/themes/buha/layouts/partials/layout/gen_list.html
index eae3ea1..a3fe9d8 100644
--- a/themes/buha/layouts/partials/layout/gen_list.html
+++ b/themes/buha/layouts/partials/layout/gen_list.html
@@ -70,6 +70,7 @@
{{ .Title }}
{{ if $title }}{{ else }}{{ end }}
{{ with .Resources.GetMatch $banner }}
+ {{ $img := . }}
{{ $good_w := "1920"}}
{{ $good_h := "550"}}
{{ $b := true }}
@@ -108,7 +109,15 @@
{{ if eq $b true }}
-
+ {{ $tiny := ($banner.Fill "768x280 q90") }}
+ {{ $small := ($banner.Fill "1024x280 q90") }}
+ {{ $medium := ($banner.Fill "1280x280 q90") }}
+ {{ $large := ($banner.Fill "1366x280 q90") }}
+
{{ end }}
{{ else }}
{{ if eq hugo.Environment "development" }}
diff --git a/themes/buha/layouts/partials/snippets/banner.html b/themes/buha/layouts/partials/snippets/banner.html
index f509f99..95f5bd2 100644
--- a/themes/buha/layouts/partials/snippets/banner.html
+++ b/themes/buha/layouts/partials/snippets/banner.html
@@ -7,7 +7,7 @@
{{ $good_w := "1920"}}
{{ $good_h := "850"}}
{{ $what := "none" }}
-{{ $img := "none" }}
+{{ $img := "" }}
{{ if eq .Kind "home" }}
{{ $what = "home" }}
{{ else if eq .Kind "term" }}
@@ -38,7 +38,13 @@
{{ with .File }}
{{ $slug = anchorize .ContentBaseName }}
{{ end }}
-{{ if and (ne $img "none") (ne .Params.banner false) }}
+{{ if and ($img) (ne .Params.banner false) }}
+ {{ if .Resources.Match "banner*" }}
+ {{ $img = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ if .Resources.ByType "image" }}
+ {{ $img = index (.Resources.ByType "image") 0 }}
+ {{ end }}
{{ if eq hugo.Environment "development" }}
@@ -75,82 +81,6 @@
{{ end }}
{{ if not .IsHome }}
{{ $title }}
{{ end }}
-{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }}
- {{ $img = .Resources.GetMatch "banner*" }}
-
- {{ if eq hugo.Environment "development" }}
-
- {{ $w := (index (.Resources.Match "banner*") 0).Width }}
- {{ $h := (index (.Resources.Match "banner*") 0).Height }}
- {{ if lt (int $w) $good_w }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Width: {{ $w }}px: too small, better {{ $good_w -}}px in width
- {{ end }}
- {{ else if gt (int $w) $good_w }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Width: {{ $w }}px: too big, better {{ $good_w -}}px in width
- {{ end }}
- {{ end }}
- {{ if lt (int $h) $good_h }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Height: {{ $h }}px: too small, better {{ $good_h -}}px in height
- {{ end }}
- {{ else if gt (int $h) $good_h }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Height: {{ $h }}px: too big, better {{ $good_h -}}px in height
- {{ end }}
- {{ end }}
- {{ if eq hugo.Environment "development" }}
- {{ if eq $b false }}
- {{ printf "Please correct content/news/%s/%s" $slug $img.Name }}
- {{ end }}
- {{ end }}
-
- {{ end }}
- {{ if not .IsHome }}
{{ $title }}
{{ end }}
-
-{{ else if and (.Resources.ByType "image") (ne .Params.banner false) (not true) }}
- {{ $img = index (.Resources.ByType "image") 0 }}
-
- {{ if eq hugo.Environment "development" }}
-
- {{ $w := (index (.Resources.ByType "image") 0).Width }}
- {{ $h := (index (.Resources.ByType "image") 0).Height }}
- {{ if lt (int $w) $good_w }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Width: {{ $w }}px: too small, better {{ $good_w -}}px in width
- {{ end }}
- {{ else if gt (int $w) $good_w }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Width: {{ $w }}px: too big, better {{ $good_w -}}px in width
- {{ end }}
- {{ end }}
- {{ if lt (int $h) $good_h }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Height: {{ $h }}px: too small, better {{ $good_h -}}px in height
- {{ end }}
- {{ else if gt (int $h) $good_h }}
- {{ $b = false }}
- {{ if eq hugo.Environment "development" }}
- Height: {{ $h }}px: too big, better {{ $good_h -}}px in height
- {{ end }}
- {{ end }}
- {{ if eq hugo.Environment "development" }}
- {{ if eq $b false }}
- {{ printf "Please correct content/news/%s/%s" $slug $img.Name }}
- {{ end }}
- {{ end }}
-
- {{ end }}
- {{ if not .IsHome }}
{{ $title }}
{{ end }}
-
{{ else }}
{{ if eq hugo.Environment "development" }}
@@ -172,3 +102,4 @@
{{ if not .IsHome }}
{{ $title }}
{{ end }}
{{ end }}
+