Fix page after upgrade in Hugo

This commit is contained in:
Christian Wolf 2023-07-27 11:40:31 +02:00
parent c63201cbb0
commit 6b8d74ccf2
3 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{{ with .Site.GetPage "person" }} {{ with .Site.GetPage "person" }}
{{ with .GetPage ($.Get "name") }} {{ with .GetPage ($.Get "name") }}
{{ $imageName := .Params.Get "image" }} {{ $imageName := .Params.image }}
{{ $image := "" }} {{ $image := "" }}
{{ with .Resources.GetMatch $imageName}} {{ with .Resources.GetMatch $imageName}}
{{ $image = .RelPermalink }} {{ $image = .RelPermalink }}
@ -9,11 +9,11 @@
{{ with .Resources.ByType "image" }} {{ with .Resources.ByType "image" }}
{{ $image = (index . 0).RelPermalink }} {{ $image = (index . 0).RelPermalink }}
{{ else }} {{ else }}
{{ with .Params.Get "sex" }} {{ with .Params.sex }}
{{ if eq . "male" }} {{ if eq . "male" }}
{{ $image = relURL "img/persons/male.png" }} {{ $image = relURL "img/persons/male.png" }}
{{ else }} {{ else }}
{{ errorf "Generic female icon not found." }} {{ $image = relURL "img/persons/female.png" }}
{{ end }} {{ end }}
{{ else }} {{ else }}
{{ warnf "Cannot find sex of %s." ($.Get "name") }} {{ warnf "Cannot find sex of %s." ($.Get "name") }}
@ -23,12 +23,12 @@
{{ $config := {{ $config :=
dict dict
"image" $image "image" $image
"name" (.Params.Get "title") "name" (.Params.title)
}} }}
{{ partial "tsc/start-person" $config }} {{ partial "tsc/start-person" $config }}
<div class="content content-trainer"> <div class="content content-trainer">
<div class="name"> <div class="name">
{{- .Params.Get "title" -}} {{- .Params.title -}}
</div> </div>
</div> </div>
{{ partial "tsc/end-person" . }} {{ partial "tsc/end-person" . }}

View File

@ -1,6 +1,6 @@
{{ with .Site.GetPage "person" }} {{ with .Site.GetPage "person" }}
{{ with .GetPage ($.Get "name") }} {{ with .GetPage ($.Get "name") }}
{{ $imageName := .Params.Get "image" }} {{ $imageName := .Params.image }}
{{ $image := "" }} {{ $image := "" }}
{{ with .Resources.GetMatch $imageName}} {{ with .Resources.GetMatch $imageName}}
{{ $image = .RelPermalink }} {{ $image = .RelPermalink }}
@ -9,11 +9,11 @@
{{ with .Resources.ByType "image" }} {{ with .Resources.ByType "image" }}
{{ $image = (index . 0).RelPermalink }} {{ $image = (index . 0).RelPermalink }}
{{ else }} {{ else }}
{{ with .Params.Get "sex" }} {{ with .Params.sex }}
{{ if eq . "male" }} {{ if eq . "male" }}
{{ $image = relURL "img/persons/male.png" }} {{ $image = relURL "img/persons/male.png" }}
{{ else }} {{ else }}
{{ errorf "Generic female icon not found." }} {{ $image = relURL "img/persons/female.png" }}
{{ end }} {{ end }}
{{ else }} {{ else }}
{{ warnf "Cannot find sex of %s." ($.Get "name") }} {{ warnf "Cannot find sex of %s." ($.Get "name") }}
@ -23,7 +23,7 @@
{{ $config := {{ $config :=
dict dict
"image" $image "image" $image
"name" (.Params.Get "title") "name" (.Params.title)
}} }}
{{ partial "tsc/start-person" $config }} {{ partial "tsc/start-person" $config }}
<div class="content content-vorstand"> <div class="content content-vorstand">
@ -32,7 +32,7 @@
{{ with $.Get "mail" }} {{ with $.Get "mail" }}
<a href="mailto:{{ . }}"><img src="/img/mail.jpg" class="mail-icon"></a> <a href="mailto:{{ . }}"><img src="/img/mail.jpg" class="mail-icon"></a>
{{ end }} {{ end }}
{{ .Params.Get "title" }} {{ .Params.title }}
</div> </div>
</div> </div>
{{ partial "tsc/end-person" . }} {{ partial "tsc/end-person" . }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB