FIX display of content and image of posts in list and single, FIX team list display

This commit is contained in:
Hoernschen 2025-08-11 21:48:18 +02:00
parent e21c1e2182
commit 58274050ef
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
8 changed files with 100 additions and 89 deletions

View file

@ -213,14 +213,14 @@ img {
flex-wrap: wrap; flex-wrap: wrap;
gap: 2rem; gap: 2rem;
justify-content: center; justify-content: center;
a {
color: inherit;
margin: 0 auto;
.member { .member {
display: inline-block; display: inline-block;
align-items: center; align-items: center;
text-align: center; text-align: center;
padding: 1rem; padding: 1rem;
a {
color: inherit;
margin: 0 auto;
.title { .title {
font-size: x-large; font-size: x-large;
padding-bottom: 0.1rem; padding-bottom: 0.1rem;
@ -560,10 +560,6 @@ button {
} }
} }
.noCover {
object-fit: unset !important;
}
.cardTitle { .cardTitle {
text-align: center; text-align: center;
font-size: 18px; font-size: 18px;
@ -597,7 +593,11 @@ button {
height: 60vh; height: 60vh;
min-width: 100%; min-width: 100%;
padding-top: 68px; padding-top: 68px;
object-fit: cover; object-fit: contain;
}
.cover {
object-fit: cover !important;
} }
.image-copyright { .image-copyright {

View file

@ -15,7 +15,7 @@
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}} {{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Summary | safeHTML | truncate 320 }}</div> <div class="cardDescription">{{ .Summary | plainify | truncate 320 }}</div>
<div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div> <div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div>
</div> </div>
</a> </a>

View file

@ -18,7 +18,10 @@
<a href="{{ .url }}"> <a href="{{ .url }}">
<div class="cardContent"> <div class="cardContent">
{{ if .image }} {{ if .image }}
{{ $style := "cardImage {{if ne .Params.image.cover }} noCover {{ end }}" }} {{ $style := "cardImage" }}
{{ if .Params.image.cover }}
{{ $style = "cardImage cover" }}
{{ end }}
{{- partial "components/image.html" (dict "style" $style "url" .image.url "alt" .image.alt) -}} {{- partial "components/image.html" (dict "style" $style "url" .image.url "alt" .image.alt) -}}
{{ else if .icon }} {{ else if .icon }}
<div class="cardImage"> <div class="cardImage">

View file

@ -8,15 +8,14 @@
{{else if .id}} {{else if .id}}
{{- $id = .id }} {{- $id = .id }}
{{end}} {{end}}
{{- $members := where $pages "Params.leaveDate" "==" nil}} {{- $members := where $pages "Params.leaveDate" "==" nil}} {{- $first := $team.first | default 4}}
{{- $first := $team.first | default 4}}
<div id="{{ $id }}" class="section {{if eq $odd 0}} section-even {{end}}"> <div id="{{ $id }}" class="section {{if eq $odd 0}} section-even {{end}}">
<div class="section-content team"> <div class="section-content team">
{{ partial "components/title.html" $team.title }} {{ partial "components/title.html" $team.title }}
<div class="list"> <div class="list">
{{- range first $first ($members.ByParam "startDate") }} {{- range first $first ($members.ByParam "startDate") }}
<a href="{{.Permalink}}">
<div class="member"> <div class="member">
<a href="{{.Permalink}}">
{{ if .Params.image }} {{ if .Params.image }}
{{- partial "components/image.html" (dict "style" "avatar" "url" .Params.image "alt" .Params.name) -}} {{- partial "components/image.html" (dict "style" "avatar" "url" .Params.image "alt" .Params.name) -}}
{{ else }} {{ else }}
@ -26,19 +25,19 @@
{{- range .Params.jobs }} {{- range .Params.jobs }}
<p>{{ . }}</p> <p>{{ . }}</p>
{{- end }} {{- end }}
</a>
<div class="social-media"> <div class="social-media">
<span> <span>
{{- range .Params.social}} {{- range .Params.social}}
{{ partial "components/icon.html" . }} {{ partial "components/icon.html" . }}
{{- end}} {{- end}}
{{ if .Params.mail }} {{ if .Params.mail }}
{{ $mailto := "mailto:{{ .Params.mail }}" }} {{ $mailto := printf "mailto:%s" .Params.mail }}
{{ partial "components/icon.html" (dict "type" "at" "url" $mailto) }} {{ partial "components/icon.html" (dict "type" "at" "url" $mailto) }}
{{ end }} {{ end }}
</span> </span>
</div> </div>
</div> </div>
</a>
{{- end }} {{- end }}
</div> </div>
{{ if gt $members.Len $first }} {{ if gt $members.Len $first }}

View file

@ -11,13 +11,16 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="cardContent"> <div class="cardContent">
{{ if .Params.image }} {{ if .Params.image }}
{{ $style := "cardImage {{if ne .Params.image.cover }} noCover {{ end }}" }} {{ $style := "cardImage" }}
{{ if .Params.image.cover }}
{{ $style = "cardImage cover" }}
{{ end }}
{{- partial "components/image.html" (dict "style" $style "url" .Params.image.url "alt" .Params.image.alt) -}} {{- partial "components/image.html" (dict "style" $style "url" .Params.image.url "alt" .Params.image.alt) -}}
{{ else }} {{ else }}
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}} {{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Summary | safeHTML | truncate 320 }}</div> <div class="cardDescription">{{ .Summary | plainify | truncate 320 }}</div>
<div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div> <div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div>
</div> </div>
</a> </a>

View file

@ -1,6 +1,9 @@
{{ define "main" }} {{ define "main" }}
{{ with .Params.image }} {{ with .Params.image }}
{{ $style := "coverimage {{if ne .Params.image.cover }} noCover {{ end }}" }} {{ $style := "coverimage" }}
{{ if .cover }}
{{ $style = "coverimage cover" }}
{{ end }}
{{- partial "components/image.html" (dict "style" $style "url" .url "alt" .alt) -}} {{- partial "components/image.html" (dict "style" $style "url" .url "alt" .alt) -}}
{{ with .copyright }} {{ with .copyright }}
<div class="image-copyright">© {{ . }}</div> <div class="image-copyright">© {{ . }}</div>
@ -38,7 +41,7 @@
{{ partial "components/icon.html" . }} {{ partial "components/icon.html" . }}
{{- end}} {{- end}}
{{if .Params.mail}} {{if .Params.mail}}
{{ partial "components/icon.html" (dict "type" "at" "url" "mailto:{{ .Params.mail }}") }} {{ partial "components/icon.html" (dict "type" "at" "url" (printf "mailto:%s" .Params.mail) ) }}
{{end}} {{end}}
</span> </span>
</div> </div>

View file

@ -6,8 +6,8 @@
</article> </article>
<div class="list"> <div class="list">
{{ range (where .Pages "Params.leaveDate" "==" nil).ByParam "startDate" }} {{ range (where .Pages "Params.leaveDate" "==" nil).ByParam "startDate" }}
<a href="{{.Permalink}}">
<div class="member"> <div class="member">
<a href="{{.Permalink}}">
{{ if .Params.image }} {{ if .Params.image }}
{{- partial "components/image.html" (dict "style" "avatar" "url" .Params.image "alt" .Params.name) -}} {{- partial "components/image.html" (dict "style" "avatar" "url" .Params.image "alt" .Params.name) -}}
{{ else }} {{ else }}
@ -17,18 +17,18 @@
{{- range .Params.jobs }} {{- range .Params.jobs }}
<p>{{ . }}</p> <p>{{ . }}</p>
{{- end }} {{- end }}
</a>
<div class="social-media"> <div class="social-media">
<span> <span>
{{- range .Params.social }} {{- range .Params.social }}
{{ partial "components/icon.html" . }} {{ partial "components/icon.html" . }}
{{- end }} {{- end }}
{{if .Params.mail}} {{if .Params.mail}}
{{ partial "components/icon.html" (dict "type" "at" "url" "mailto:{{ .Params.mail }}") }} {{ partial "components/icon.html" (dict "type" "at" "url" (printf "mailto:%s" .Params.mail) ) }}
{{end}} {{end}}
</span> </span>
</div> </div>
</div> </div>
</a>
{{ end }} {{ end }}
</div> </div>
</div> </div>

View file

@ -13,7 +13,7 @@
{{ partial "components/icon.html" . }} {{ partial "components/icon.html" . }}
{{- end}} {{- end}}
{{if .Params.mail}} {{if .Params.mail}}
{{ partial "components/icon.html" (dict "type" "at" "url" "mailto:{{ .Params.mail }}") }} {{ partial "components/icon.html" (dict "type" "at" "url" (printf "mailto:%s" .Params.mail) ) }}
{{end}} {{end}}
</span> </span>
</div> </div>
@ -35,13 +35,16 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="cardContent"> <div class="cardContent">
{{ if .Params.image }} {{ if .Params.image }}
{{ $style := "cardImage {{if ne .Params.image.cover }} noCover {{ end }}" }} {{ $style := "cardImage" }}
{{ if .Params.image.cover }}
{{ $style = "cardImage cover" }}
{{ end }}
{{- partial "components/image.html" (dict "style" $style "url" .Params.image.url "alt" .Params.image.alt) -}} {{- partial "components/image.html" (dict "style" $style "url" .Params.image.url "alt" .Params.image.alt) -}}
{{ else }} {{ else }}
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}} {{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Summary | safeHTML | truncate 320 }}</div> <div class="cardDescription">{{ .Summary | plainify | truncate 320 }}</div>
<div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div> <div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div>
</div> </div>
</a> </a>