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

@ -18,7 +18,10 @@
<a href="{{ .url }}">
<div class="cardContent">
{{ 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) -}}
{{ else if .icon }}
<div class="cardImage">

View file

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