CHANGE team list: Make number of team members on front page configurable

This commit is contained in:
Hoernschen 2025-08-11 15:41:21 +02:00
parent 9b6557bb0c
commit e21c1e2182
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
3 changed files with 32 additions and 23 deletions

View file

@ -8,11 +8,13 @@
{{else if .id}}
{{- $id = .id }}
{{end}}
{{- $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 4 ((where $pages "Params.leaveDate" "==" nil).ByParam "startDate") }}
{{- range first $first ($members.ByParam "startDate") }}
<a href="{{.Permalink}}">
<div class="member">
{{ if .Params.image }}
@ -20,7 +22,7 @@
{{ else }}
{{- partial "components/image.html" (dict "style" "avatar" "url" $defaultimage "alt" "Placeholder") -}}
{{ end }}
<h1 class="teammember-title">{{ .Params.name }}</h1>
<h1 class="title">{{ .Params.name }}</h1>
{{- range .Params.jobs }}
<p>{{ . }}</p>
{{- end }}
@ -39,6 +41,8 @@
</a>
{{- end }}
</div>
{{ partial "components/button.html" (dict "type" "text block" "url" $team.id "text" ($team.more | default "More")) }}
{{ if gt $members.Len $first }}
{{ partial "components/button.html" (dict "type" "text block" "url" $team.id "text" ($team.more | default "More")) }}
{{ end }}
</div>
</div>