small fixes

This commit is contained in:
teldra 2022-06-15 13:46:50 +02:00
parent 0bb9e71256
commit d645142f01
5 changed files with 53 additions and 63 deletions

View File

Before

Width:  |  Height:  |  Size: 286 KiB

After

Width:  |  Height:  |  Size: 286 KiB

View File

@ -6,4 +6,5 @@ when: "Mittwochs 16.00-19.00Uhr und Sonntags 14.00-17.00Uhr"
tags: ["Cafe"]
recurrent: true
---
![Flyer](1)
Seit August gibt es im Bunten Haus das "Offene Café" immer Mittwochs 16.00 - 19.00 Uhr und Sonntags 14.00 - 17.00 Uhr: Wir haben leckeren Kaffee, Espresso, Tee und weitere Getränke und manchmal auch Kuchen. Wir freuen uns, wenn ihr vorbeischaut. Wir sehen uns dort!

View File

@ -63,27 +63,32 @@
{{ $good_w := "1920"}}
{{ $good_h := "550"}}
{{ $b := true }}
{{ if lt (int .Width) $good_w }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Width: {{ .Width }}px: too small, better {{ $good_w -}}px in width<br>
{{ if or (lt (int .Width) $good_w) (gt (int .Width) $good_w) (lt (int .Height) $good_h) (gt (int .Height) $good_h) }}
<div style="margin: 1rem;">
Banner not shown, because:<br>
{{ if lt (int .Width) $good_w }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Width: {{ .Width }}px: too small, must be {{ $good_w -}}px in width<br>
{{ end }}
{{ else if gt (int .Width) $good_w }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Width: {{ .Width }}px: too big, must be {{ $good_w -}}px in width<br>
{{ end }}
{{ end }}
{{ else if gt (int .Width) $good_w }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Width: {{ .Width }}px: too big, better {{ $good_w -}}px in width<br>
{{ end }}
{{ end }}
{{ if lt (int .Height) $good_h }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Height: {{ .Height }}px: too small, better {{ $good_h -}}px in height<br>
{{ end }}
{{ else if gt (int .Height) $good_h }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Height: {{ .Height }}px: too big, better {{ $good_h -}}px in height<br>
{{ if lt (int .Height) $good_h }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Height: {{ .Height }}px: too small, must be {{ $good_h -}}px in height<br>
{{ end }}
{{ else if gt (int .Height) $good_h }}
{{ $b = false }}
{{ if eq hugo.Environment "development" }}
Height: {{ .Height }}px: too big, must be {{ $good_h -}}px in height<br>
{{ end }}
{{ end }}
</div>
{{ end }}
<!--<div class="img" style="background-image: url({{ .Permalink }})">
</div>-->

View File

@ -1,5 +1,6 @@
{{ $type := .type }}
<div>
{{ range .pages }}
<a href="{{ .Page.Permalink }}" style="margin-right: 1rem;">{{ .Page.Title }} {{ if eq $type "tags"}}{{ .Count }}{{ end }}</a>
<a href="{{ .Page.Permalink }}" class="underline" style="margin-right: 1rem;">{{ .Page.Title }} {{ if eq $type "tags"}}{{ .Count }}{{ end }}</a>
{{ end }}
</div>

View File

@ -7,21 +7,33 @@
{{ $good_w := "1920"}}
{{ $good_h := "850"}}
{{ $what := "none" }}
{{ $missing := "" }}
{{ $banner := "" }}
{{ $img := "none" }}
{{ if eq .Kind "home" }}
{{ $what = "home" }}
{{ else }}
{{ $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 }}
{{ $banner := string (printf "/images/banner/%s*" $what) }}
{{ if resources.GetMatch $banner }}
{{ $img = resources.GetMatch $banner }}
{{ end }}
@ -33,25 +45,25 @@
<div style="background-image: url({{- $img.Permalink -}})" class="banner {{ $css }}">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<div style="color: black;">
<div style="color: red;">
{{ $w := (resources.GetMatch $banner).Width }}
{{ $h := (resources.GetMatch $banner).Height }}
{{ if lt (int $w) $good_w }}
{{ if eq hugo.Environment "development" }}
Width: {{ $w }}px: too small, better {{ $good_w -}}px in width<br>
Width: {{ $w }}px: too small, must be {{ $good_w -}}px in width<br>
{{ end }}
{{ else if gt (int $w) $good_w }}
{{ if eq hugo.Environment "development" }}
Width: {{ $w }}px: too big, better {{ $good_w -}}px in width<br>
Width: {{ $w }}px: too big, must be {{ $good_w -}}px in width<br>
{{ end }}
{{ end }}
{{ if lt (int $h) $good_h }}
{{ if eq hugo.Environment "development" }}
Height: {{ $h }}px: too small, better {{ $good_h -}}px in height<br>
Height: {{ $h }}px: too small, must be {{ $good_h -}}px in height<br>
{{ end }}
{{ else if gt (int $h) $good_h }}
{{ if eq hugo.Environment "development" }}
Height: {{ $h }}px: too big, better {{ $good_h -}}px in height<br>
Height: {{ $h }}px: too big, must be {{ $good_h -}}px in height<br>
{{ end }}
{{ end }}
</div>
@ -62,54 +74,25 @@
<div style="background-image:url({{- $img.Permalink -}})" class="banner {{ $css }}">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<div style="color: black;">
<div style="color: red;">
{{ $w := (index (.Resources.Match "banner*") 0).Width }}
{{ $h := (index (.Resources.Match "banner*") 0).Height }}
{{ if lt (int $w) $good_w }}
{{ if eq hugo.Environment "development" }}
Width: {{ $w }}px: too small, better {{ $good_w -}}px in width<br>
Width: {{ $w }}px: too small, must be {{ $good_w -}}px in width<br>
{{ end }}
{{ else if gt (int $w) $good_w }}
{{ if eq hugo.Environment "development" }}
Width: {{ $w }}px: too big, better {{ $good_w -}}px in width<br>
Width: {{ $w }}px: too big, must be {{ $good_w -}}px in width<br>
{{ end }}
{{ end }}
{{ if lt (int $h) $good_h }}
{{ if eq hugo.Environment "development" }}
Height: {{ $h }}px: too small, better {{ $good_h -}}px in height<br>
Height: {{ $h }}px: too small, must be {{ $good_h -}}px in height<br>
{{ end }}
{{ else if gt (int $h) $good_h }}
{{ if eq hugo.Environment "development" }}
Height: {{ $h }}px: too big, better {{ $good_h -}}px in height<br>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
{{ else if and (.Resources.ByType "image") (ne .Params.banner false) (not true) }}
{{ $img = index (.Resources.ByType "image") 0 }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner {{ $css }}">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
<div style="color: black;">
{{ $w := (index (.Resources.ByType "image") 0).Width }}
{{ $h := (index (.Resources.ByType "image") 0).Height }}
{{ if lt (int $w) $good_w }}
{{ if eq hugo.Environment "development" }}
Width: {{ $w }}px: too small, better {{ $good_w -}}px in width<br>
{{ end }}
{{ else if gt (int $w) $good_w }}
{{ if eq hugo.Environment "development" }}
Width: {{ $w }}px: too big, better {{ $good_w -}}px in width<br>
{{ end }}
{{ end }}
{{ if lt (int $h) $good_h }}
{{ if eq hugo.Environment "development" }}
Height: {{ $h }}px: too small, better {{ $good_h -}}px in height<br>
{{ end }}
{{ else if gt (int $h) $good_h }}
{{ if eq hugo.Environment "development" }}
Height: {{ $h }}px: too big, better {{ $good_h -}}px in height<br>
Height: {{ $h }}px: too big, must be {{ $good_h -}}px in height<br>
{{ end }}
{{ end }}
</div>
@ -119,7 +102,7 @@
<div class="banner non_banner_height">
{{ if not .IsHome }}<h1 class="{{ $title_class }}">{{ $title }}</h1> {{ end }}
{{ if eq hugo.Environment "development" }}
{{ $str1 := printf "assets/images/banner/%s* missing.." $what }}
{{ $str1 := printf "assets%s missing.." $missing }}
{{ $str2 := "" }}
{{ with .File }}
{{ $str2 = printf "content/%sbanner* missing.." .Dir }}