- {{ partial "snippets/banner" . -}}
+ {{ block "banner" . -}} {{ partial "snippets/banner" . -}}{{- end }}
{{ if not .IsHome}}
diff --git a/themes/buha/layouts/_default/taxonomy.html b/themes/buha/layouts/_default/taxonomy.html
index 72b10c42..59e86262 100644
--- a/themes/buha/layouts/_default/taxonomy.html
+++ b/themes/buha/layouts/_default/taxonomy.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "content" }}
{{ if eq .Kind "taxonomy" }}
diff --git a/themes/buha/layouts/_default/term.html b/themes/buha/layouts/_default/term.html
new file mode 100644
index 00000000..59e86262
--- /dev/null
+++ b/themes/buha/layouts/_default/term.html
@@ -0,0 +1,20 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
+{{ define "content" }}
+ {{ if eq .Kind "taxonomy" }}
+
+ {{ else }}
+ {{- $pages := .Data.Pages -}}
+ {{ partial "snippets/gen_list" (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" true) }}
+ {{ end }}
+{{ end }}
diff --git a/themes/buha/layouts/about/list.html b/themes/buha/layouts/about/list.html
index 43e3a3c7..927054c1 100644
--- a/themes/buha/layouts/about/list.html
+++ b/themes/buha/layouts/about/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/archive/list.html b/themes/buha/layouts/archive/list.html
index f1a24065..33e34421 100644
--- a/themes/buha/layouts/archive/list.html
+++ b/themes/buha/layouts/archive/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .context.Content) }}
diff --git a/themes/buha/layouts/contact/list.html b/themes/buha/layouts/contact/list.html
index f6d8ecc8..13cee9e2 100644
--- a/themes/buha/layouts/contact/list.html
+++ b/themes/buha/layouts/contact/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "content" }}
{{ $text := "solo" }}
{{ $content := .Content }}
diff --git a/themes/buha/layouts/events/list.html b/themes/buha/layouts/events/list.html
index 7b7c3411..63baf4af 100644
--- a/themes/buha/layouts/events/list.html
+++ b/themes/buha/layouts/events/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
@@ -6,7 +14,11 @@
{{ define "content" }}
{{- $pages := where .Site.RegularPages "Section" "in" .Site.Params.searchSections -}}
- {{- $pages = where $pages ".Params.when" "ne" nil -}}
+ {{ if eq .Kind "taxonomy" }}
+ {{- $pages = where $pages ".Params.when" "ne" nil -}}
+ {{ else if eq .Kind "term" }}
+ {{- $pages = .Data.Pages -}}
+ {{ end }}
{{ partial "snippets/gen_list" (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" true) }}
{{ end }}
diff --git a/themes/buha/layouts/featured/list.html b/themes/buha/layouts/featured/list.html
index 2d5d8241..a820993d 100644
--- a/themes/buha/layouts/featured/list.html
+++ b/themes/buha/layouts/featured/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/files/list.html b/themes/buha/layouts/files/list.html
index f0d51486..4a6ab768 100644
--- a/themes/buha/layouts/files/list.html
+++ b/themes/buha/layouts/files/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/imprint/list.html b/themes/buha/layouts/imprint/list.html
index 5ab4fe27..4b12dec3 100644
--- a/themes/buha/layouts/imprint/list.html
+++ b/themes/buha/layouts/imprint/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "content" }}
{{ $text := "solo" }}
{{ $content := .Content }}
diff --git a/themes/buha/layouts/index.html b/themes/buha/layouts/index.html
index 4d290310..55fc4082 100644
--- a/themes/buha/layouts/index.html
+++ b/themes/buha/layouts/index.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
diff --git a/themes/buha/layouts/links/list.html b/themes/buha/layouts/links/list.html
index dfb1a8ed..1b85e69e 100644
--- a/themes/buha/layouts/links/list.html
+++ b/themes/buha/layouts/links/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/news/list.html b/themes/buha/layouts/news/list.html
index b0264b65..5f18eb04 100644
--- a/themes/buha/layouts/news/list.html
+++ b/themes/buha/layouts/news/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
@@ -6,6 +14,9 @@
{{ define "content" }}
{{- $pages := where .Site.RegularPages "Section" "in" .Site.Params.searchSections -}}
+ {{ if eq .Kind "term" }}
+ {{- $pages = .Data.Pages -}}
+ {{ end }}
{{ partial "snippets/gen_list" (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" true) }}
{{ end }}
diff --git a/themes/buha/layouts/newsletter/list.html b/themes/buha/layouts/newsletter/list.html
index 9f6afc28..7117bc84 100644
--- a/themes/buha/layouts/newsletter/list.html
+++ b/themes/buha/layouts/newsletter/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "content" }}
{{- if .Description -}}
diff --git a/themes/buha/layouts/partials/debug.html b/themes/buha/layouts/partials/debug.html
deleted file mode 100644
index 188f46f8..00000000
--- a/themes/buha/layouts/partials/debug.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ if eq site.Params.debug true }}
-Title: {{ .context.Title }}
-Name: {{ .context.Name }}
-section: {{ .context.Section }}
-type: {{ .context.Type }}
-layout: {{ .context.Layout }}
-{{ if .caller }}caller: {{ .caller }}
{{ end }}
-kind: {{ .context.Kind }}
-is page: {{ if .context.IsPage }}yes{{end}}
-{{ end }}
diff --git a/themes/buha/layouts/partials/snippets/banner.html b/themes/buha/layouts/partials/snippets/banner.html
index 8912ff50..dd154abb 100644
--- a/themes/buha/layouts/partials/snippets/banner.html
+++ b/themes/buha/layouts/partials/snippets/banner.html
@@ -1,6 +1,6 @@
{{ define "debug" }}
{{ .Section }}
-{{ end }}
+{{ end }}OLD
{{ $title := .Title }}
{{ $title = singularize $title }}
{{ $title = i18n $title }}
@@ -140,4 +140,4 @@
{{ if not .IsHome }}{{ $title }}
{{ end }}
{{ end }}
-
+OLD
diff --git a/themes/buha/layouts/partials/snippets/banner_new.html b/themes/buha/layouts/partials/snippets/banner_new.html
new file mode 100644
index 00000000..e12e15ff
--- /dev/null
+++ b/themes/buha/layouts/partials/snippets/banner_new.html
@@ -0,0 +1,72 @@
+{{ $img := .image }}
+{{ if .Resources.GetMatch .image }}
+ {{ $img = .Resources.GetMatch .image }}
+{{ else if resources.GetMatch .image }}
+ {{ $img = resources.GetMatch .image }}
+{{ end }}
+
+{{ $title := .title }}
+{{ $good_w := "1920"}}
+{{ $good_h := "850"}}
+{{ $banner := .context.Params.banner }}
+
+{{ $test := true }}
+{{ if and $img (ne $banner false) }}
+ {{ $tiny := ($img.Resize "640x q90") }}
+ {{ $small := ($img.Resize "768x q90") }}
+ {{ $medium := ($img.Resize "10240x q90") }}
+ {{ $large := ($img.Resize "1366x q90") }}
+
+ {{ if eq hugo.Environment "development" }}
+
+ {{ $w := $img.Width }}
+ {{ $h := $img.Height }}
+ {{ if lt (int $w) $good_w }}
+ {{ $test = false }}
+ {{ if eq hugo.Environment "development" }}
+ Width: {{ $w }}px: too small, better {{ $good_w -}}px in width
+ {{ end }}
+ {{ else if gt (int $w) $good_w }}
+ {{ $test = false }}
+ {{ if eq hugo.Environment "development" }}
+ Width: {{ $w }}px: too big, better {{ $good_w -}}px in width
+ {{ end }}
+ {{ end }}
+ {{ if lt (int $h) $good_h }}
+ {{ $test = false }}
+ {{ if eq hugo.Environment "development" }}
+ Height: {{ $h }}px: too small, better {{ $good_h -}}px in height
+ {{ end }}
+ {{ else if gt (int $h) $good_h }}
+ {{ $test = false }}
+ {{ if eq hugo.Environment "development" }}
+ Height: {{ $h }}px: too big, better {{ $good_h -}}px in height
+ {{ end }}
+ {{ end }}
+ {{ if eq hugo.Environment "development" }}
+ {{ if eq $test false }}
+ {{ printf "Please correct %s" $img }}
+ {{ end }}
+ {{ end }}
+
+ {{ end }}
+ {{ if $title }}
{{ $title }}
{{ end }}
+
+{{ else }}
+
+ {{ if eq hugo.Environment "development" }}
+ {{ $c := "" }}
+ {{ $str := "" }}
+ {{ if eq $banner false }}
+ {{ $c = "black" }}
+ {{ $str = "Info: Banner is turned off for this." }}
+ {{ else }}
+ {{ $str = printf "content/%s/banner* missing.." .section }}
+ {{ end }}
+
+ {{ $str }}
+
+ {{ end }}
+ {{ if $title }}
{{ $title }}
{{ end }}
+
+{{ end }}
diff --git a/themes/buha/layouts/posts/list.html b/themes/buha/layouts/posts/list.html
index b0264b65..aff8bcd7 100644
--- a/themes/buha/layouts/posts/list.html
+++ b/themes/buha/layouts/posts/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/posts/single.html b/themes/buha/layouts/posts/single.html
index 57b389e7..a71150f6 100644
--- a/themes/buha/layouts/posts/single.html
+++ b/themes/buha/layouts/posts/single.html
@@ -1,3 +1,12 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ $banner := "banner*" }}
+ {{ if .Resources.GetMatch $banner }}
+ {{ $image = .Resources.GetMatch $banner }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "content" }}
{{ $metas := dict "when" .Params.when "price" .Params.price "contact_mail" .Params.contact_mail "covid" .Params.covid "insta" .Params.insta }}
diff --git a/themes/buha/layouts/recurrent/list.html b/themes/buha/layouts/recurrent/list.html
index 86c3a61d..037e2021 100644
--- a/themes/buha/layouts/recurrent/list.html
+++ b/themes/buha/layouts/recurrent/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/search/list.html b/themes/buha/layouts/search/list.html
index 0894768d..6eb6e139 100644
--- a/themes/buha/layouts/search/list.html
+++ b/themes/buha/layouts/search/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "content" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
diff --git a/themes/buha/layouts/tools/list.html b/themes/buha/layouts/tools/list.html
index 5e82a869..7e7db028 100644
--- a/themes/buha/layouts/tools/list.html
+++ b/themes/buha/layouts/tools/list.html
@@ -1,3 +1,11 @@
+{{ define "banner" }}
+ {{ $image := "" }}
+ {{ if .Resources.GetMatch "banner*" }}
+ {{ $image = .Resources.GetMatch "banner*" }}
+ {{ end }}
+ {{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
+{{ end }}
+
{{ define "intro" }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}