Create Vorstand page using static person data

This commit is contained in:
2023-01-20 15:14:39 +01:00
parent 00cbf57cfe
commit e0946e6c59
50 changed files with 206 additions and 60 deletions

View File

@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
draft: true
image: ""
headless: true
---

View File

@@ -1,8 +1,8 @@
<div class="person">
<div class="image">
{{- $person := . -}}
{{- with .Get "img" -}}
<img src="{{ . }}" {{ with $person.Get "name" }}alt="Bild {{ . }}"{{ end }}>
{{- $param := . -}}
{{- with .image -}}
<img src="{{ .RelPermalink }}" {{ with $param.name }}alt="Bild {{ . }}"{{ end }}>
{{- end -}}
</div>

View File

@@ -1,11 +1,35 @@
{{ partial "tsc/start-person" . }}
<div class="content content-vorstand">
<div class="role">{{ .Get "role" }}</div>
<div class="name">
{{ with .Get "mail" }}
<a href="mailto:{{ . }}"><img src="/img/mail.jpg" class="mail-icon"></a>
{{ with .Site.GetPage "person" }}
{{/*{{ $person := . }}*/}}
{{ with .GetPage ($.Get "name") }}
{{ $imageName := .Params.Get "image" }}
{{ $image := "" }}
{{ with .Resources.GetMatch $imageName}}
{{ $image = . }}
{{ else }}
{{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }}
{{ with .Resources.ByType "image" }}
{{ $image = index . 0 }}
{{ else }}
{{/* $image */}}
{{ end }}
{{ end }}
{{ .Get "name" }}
</div>
</div>
{{ partial "tsc/end-person" . }}
{{ $config :=
dict
"image" $image
"name" (.Params.Get "title")
}}
{{ partial "tsc/start-person" $config }}
<div class="content content-vorstand">
<div class="role">{{ $.Get "role" }}</div>
<div class="name">
{{ with $.Get "mail" }}
<a href="mailto:{{ . }}"><img src="/img/mail.jpg" class="mail-icon"></a>
{{ end }}
{{ .Params.Get "title" }}
</div>
</div>
{{ partial "tsc/end-person" . }}
{{ else }}
{{ errorf "Cannot find person %s." ($.Get "name") }}
{{ end }}
{{ end }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB