CHANGE team list: Make number of team members on front page configurable
This commit is contained in:
parent
9b6557bb0c
commit
e21c1e2182
3 changed files with 32 additions and 23 deletions
|
@ -207,23 +207,28 @@ img {
|
||||||
.team {
|
.team {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
.list {
|
||||||
|
|
||||||
.team-list {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
gap: 2rem;
|
||||||
|
justify-content: center;
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
.member {
|
||||||
}
|
|
||||||
|
|
||||||
.teammember {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
.title {
|
||||||
|
font-size: x-large;
|
||||||
|
padding-bottom: 0.1rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
{{else if .id}}
|
{{else if .id}}
|
||||||
{{- $id = .id }}
|
{{- $id = .id }}
|
||||||
{{end}}
|
{{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 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 4 ((where $pages "Params.leaveDate" "==" nil).ByParam "startDate") }}
|
{{- range first $first ($members.ByParam "startDate") }}
|
||||||
<a href="{{.Permalink}}">
|
<a href="{{.Permalink}}">
|
||||||
<div class="member">
|
<div class="member">
|
||||||
{{ if .Params.image }}
|
{{ if .Params.image }}
|
||||||
|
@ -20,7 +22,7 @@
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{- partial "components/image.html" (dict "style" "avatar" "url" $defaultimage "alt" "Placeholder") -}}
|
{{- partial "components/image.html" (dict "style" "avatar" "url" $defaultimage "alt" "Placeholder") -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<h1 class="teammember-title">{{ .Params.name }}</h1>
|
<h1 class="title">{{ .Params.name }}</h1>
|
||||||
{{- range .Params.jobs }}
|
{{- range .Params.jobs }}
|
||||||
<p>{{ . }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -39,6 +41,8 @@
|
||||||
</a>
|
</a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
{{ if gt $members.Len $first }}
|
||||||
{{ partial "components/button.html" (dict "type" "text block" "url" $team.id "text" ($team.more | default "More")) }}
|
{{ partial "components/button.html" (dict "type" "text block" "url" $team.id "text" ($team.more | default "More")) }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<div class="content">
|
<div class="team content">
|
||||||
<article>
|
<article>
|
||||||
{{ partial "components/title.html" .Title }}
|
{{ partial "components/title.html" .Title }}
|
||||||
{{.Content}}
|
{{.Content}}
|
||||||
</article>
|
</article>
|
||||||
<div class="team-list">
|
<div class="list">
|
||||||
{{ range (where .Pages "Params.leaveDate" "==" nil).ByParam "startDate" }}
|
{{ range (where .Pages "Params.leaveDate" "==" nil).ByParam "startDate" }}
|
||||||
<a href="{{.Permalink}}">
|
<a href="{{.Permalink}}">
|
||||||
<div class="teammember">
|
<div class="member">
|
||||||
{{ 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 }}
|
||||||
{{- partial "components/image.html" (dict "style" "avatar" "url" $.Site.Params.defaultimage "alt" "Placeholder") -}}
|
{{- partial "components/image.html" (dict "style" "avatar" "url" $.Site.Params.defaultimage "alt" "Placeholder") -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<h1 class="teammember-title">{{ .Params.name }}</h1>
|
<h1 class="title">{{ .Params.name }}</h1>
|
||||||
{{- range .Params.jobs }}
|
{{- range .Params.jobs }}
|
||||||
<p>{{ . }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue