{{ $title := .Title }} {{ $title = singularize $title }} {{ $title = i18n $title }} {{ if not $title }} {{ $title = .Title }} {{ end }} {{ $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" }} {{ 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 }} {{ if resources.GetMatch $banner }} {{ $img = resources.GetMatch $banner }} {{ end }} {{ $single := false }} {{ if and (in .File "news/") (not (in .File "_index"))}} {{ $single = true }} {{ end }} {{ if and (ne $img "none") (ne .Params.banner false) }} {{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }} {{ $img = .Resources.GetMatch "banner*" }} {{ else }} {{ end }}