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 }} - Banner Image. + {{ $tiny := ($banner.Fill "768x280 q90") }} + {{ $small := ($banner.Fill "1024x280 q90") }} + {{ $medium := ($banner.Fill "1280x280 q90") }} + {{ $large := ($banner.Fill "1366x280 q90") }} + Banner Image. {{ 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 }}