diff --git a/assets/images/banner/term/kino.webp b/assets/images/banner/term/kino.webp new file mode 100644 index 0000000..b20a2af Binary files /dev/null and b/assets/images/banner/term/kino.webp differ diff --git a/themes/buha/layouts/partials/snippets/banner.html b/themes/buha/layouts/partials/snippets/banner.html index 66f21a2..f2297dd 100644 --- a/themes/buha/layouts/partials/snippets/banner.html +++ b/themes/buha/layouts/partials/snippets/banner.html @@ -7,33 +7,25 @@ {{ $good_w := "1920"}} {{ $good_h := "850"}} {{ $what := "none" }} -{{ $missing := "" }} -{{ $banner := "" }} {{ $img := "none" }} {{ if eq .Kind "home" }} {{ $what = "home" }} - {{ $banner = "home" }} -{{ else if eq .Kind "page" }} +{{ else if eq .Kind "term" }} + {{ $what = printf "term/%s" (anchorize .Title) }} +{{ else if eq .Kind "taxonomy" }} + {{ $what = .Data.Singular }} +{{ else }} {{ with .File }} {{ $what = .File.ContentBaseName }} - {{ $banner = $what }} {{ 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 }} -{{ $missing := $banner }} {{ $title_class := safeCSS "title" }} {{ $css := safeCSS "b" }} {{ if .IsHome }} {{ $css = safeCSS "b_index" }} {{ $title_class = safeCSS "title_index" }} {{ end }} - +{{ $banner := string (printf "/images/banner/%s*" $what) }} {{ if resources.GetMatch $banner }} {{ $img = resources.GetMatch $banner }} {{ end }} @@ -41,29 +33,30 @@ {{ if and (in .File "news/") (not (in .File "_index"))}} {{ $single = true }} {{ end }} + {{ if and (ne $img "none") (ne .Params.banner false) }}