forked from Bunteshaus/bunteshaus.de
30 lines
1.3 KiB
HTML
30 lines
1.3 KiB
HTML
{{ $title := .Title }}
|
|
{{ $title = singularize $title }}
|
|
{{ $title = i18n $title }}
|
|
{{ if not $title }}
|
|
{{ $title = .Title }}
|
|
{{ end }}
|
|
|
|
{{ $what := "none" }}
|
|
{{ $img := "none" }}
|
|
{{ if eq .Kind "home" }}
|
|
{{ $what = "home" }}
|
|
{{ else }}
|
|
{{ with .File }}
|
|
{{ $what = .File.ContentBaseName }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ $banner := printf "/images/banner/%s*" $what }}
|
|
{{ if resources.GetMatch $banner }}
|
|
{{ $img = resources.GetMatch $banner }}
|
|
{{ end }}
|
|
|
|
{{ if resources.GetMatch $banner }}
|
|
<div style="background-image:linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url({{- $img.Permalink -}}); background-size: cover; min-height: 33vh; display: flex; justify-content: center; align-items: center;"><h1 style="font-size: 350%; color: white;">{{ $title }}</h1></div>
|
|
{{ else if .Resources.Match "banner*" }}
|
|
{{ $img = (.Resources.GetMatch "banner*") }}
|
|
<div style="background-image:linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url({{- $img.Permalink -}}); background-size: cover; min-height: 33vh; display: flex; justify-content: center; align-items: center;"><h1 style="font-size: 350%; color: white;">{{ $title }}</h1></div>
|
|
{{ else }}
|
|
<h1 style="margin-top: 1rem; margin-left: 2rem; margin-bottom: 0; color: white;">{{ $title }}</h1>
|
|
{{ end }}
|