{{ $title := .Title }} {{ $title = singularize $title }} {{ $title = i18n $title }} {{ if not $title }} {{ $title = .Title }} {{ end }} {{ $good_w := "1920"}} {{ $good_h := "550"}} {{ $px := string "400" }} {{ $fill := string (printf "1280x%s smart" $px) }} {{ $what := "none" }} {{ $img := "none" }} {{ if eq .Kind "home" }} {{ $what = "home" }} {{ else }} {{ with .File }} {{ $what = .File.ContentBaseName }} {{ end }} {{ end }} {{ $title_class := safeCSS "title" }} {{ if .IsHome }} {{ $title_class = safeCSS "title_index" }} {{ end }} {{ $banner := printf "/images/banner/%s*" $what }} {{ if resources.GetMatch $banner }} {{ $img = (resources.GetMatch $banner).Fill $fill }} {{ end }} {{ if and (resources.GetMatch $banner) (ne .Params.banner false) }}
{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }} {{ $img = (.Resources.GetMatch "banner*").Fill $fill }} {{ else if and (.Resources.ByType "image") (ne .Params.banner false) }} {{ $img = (index (.Resources.ByType "image") 0).Fill $fill }} {{ else }} {{ end }}