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

View file

@ -15,7 +15,7 @@
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }}
<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>
</a>

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>

View file

@ -11,13 +11,16 @@
<a href="{{.Permalink}}">
<div class="cardContent">
{{ 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) -}}
{{ else }}
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }}
<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>
</a>

View file

@ -1,6 +1,9 @@
{{ define "main" }}
{{ 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) -}}
{{ with .copyright }}
<div class="image-copyright">© {{ . }}</div>
@ -38,7 +41,7 @@
{{ partial "components/icon.html" . }}
{{- end}}
{{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}}
</span>
</div>

View file

@ -1,35 +1,35 @@
{{ define "main" }}
<div class="team content">
<article>
{{ partial "components/title.html" .Title }}
{{.Content}}
</article>
<div class="list">
{{ range (where .Pages "Params.leaveDate" "==" nil).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" $.Site.Params.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}}
{{ partial "components/icon.html" (dict "type" "at" "url" "mailto:{{ .Params.mail }}") }}
{{end}}
</span>
</div>
</div>
</a>
<article>
{{ partial "components/title.html" .Title }}
{{.Content}}
</article>
<div class="list">
{{ range (where .Pages "Params.leaveDate" "==" nil).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" $.Site.Params.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}}
{{ partial "components/icon.html" (dict "type" "at" "url" (printf "mailto:%s" .Params.mail) ) }}
{{end}}
</span>
</div>
</div>
{{ end }}
</div>
</div>
{{ end }}

View file

@ -13,7 +13,7 @@
{{ partial "components/icon.html" . }}
{{- end}}
{{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}}
</span>
</div>
@ -35,13 +35,16 @@
<a href="{{.Permalink}}">
<div class="cardContent">
{{ 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) -}}
{{ else }}
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }}
<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>
</a>