Add People List

This uses XML due to the fact that XML can peserve order, however Go, therefore hugo, does not peserve XML element order while unmarashlling, meaning that there is a bug in Go techincally... This is dissapointing to me, however the result here is good enough that I will continue to use this.
This commit is contained in:
Evan G. 2024-05-23 14:06:46 -05:00
parent c393515499
commit 8db46ba527
6 changed files with 62 additions and 67 deletions

View file

@ -1,16 +1,13 @@
{{ $data := dict }}
{{ $path := "data/people.json" }}
{{ with resources.Get $path }}
{{ with . | transform.Unmarshal }}
{{ $data = . }}
{{ end }}
{{ else }}
{{ errorf "Unable to get global resource %q" $path }}
{{ end }}
{{ range $data }}
{{ .Name }}
{{ $data := site.Data.people }}
{{ range $data.person }}
{{ .name }} {{ with .why }} for {{ . | markdownify }} {{ end }}
<ul>
<li>{{ .Website }}<ul><li>
{{ with .website }} <li>Website: <a href="https://{{ . }}">{{ . }}</a></li> {{ end }}
{{ range $key, $value := . }}
{{ if eq $key "why" "name" "website" }}
{{ continue }}
{{ end }}
<li>{{ replaceRE "1" "$1" $key | humanize }}: {{ $value | markdownify }}</li>
{{ end }}
</ul>
{{ end }}