From 8db46ba52710030a326467decd4dc47f57c33612 Mon Sep 17 00:00:00 2001 From: "Evan G." Date: Thu, 23 May 2024 14:06:46 -0500 Subject: [PATCH] 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. --- assets/data/people.json | 6 ----- content/people.md | 40 ++-------------------------- content/test.md | 8 ------ data/people.xml | 42 ++++++++++++++++++++++++++++++ hugo.toml | 8 +++++- layouts/shortcodes/peoplelist.html | 25 ++++++++---------- 6 files changed, 62 insertions(+), 67 deletions(-) delete mode 100644 assets/data/people.json delete mode 100644 content/test.md create mode 100644 data/people.xml diff --git a/assets/data/people.json b/assets/data/people.json deleted file mode 100644 index 658bf53..0000000 --- a/assets/data/people.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "Name": "Benjamin Hollon", - "Website": "benjaminhollon.com" - } -] diff --git a/content/people.md b/content/people.md index 15cb587..1ca8421 100644 --- a/content/people.md +++ b/content/people.md @@ -1,44 +1,8 @@ --- title: "A List of People" date: 2024-05-22T20:21:36-05:00 -draft: true +draft: false tags: - info --- -This is a list of people that I have collected over time: -1) Benjamin Hollon for his work on [readable.css](https://readable-css.freedomtowrite.org/) and his support on the fediverse. - * [Website](https://benjaminhollon.com/) - * Fediverse - * [@amin@alpha.polymaths.social](https://alpha.polymaths.social/@amin) - * [Codeberg](https://codeberg.org/benjaminhollon) - * [Github](https://github.com/benjaminbhollon) (Dead) - * [Other](https://benjaminhollon.com/social/) - * [Contact](https://benjaminhollon.com/contact/) -2) CJ for his work on [hugo-theme-readable](https://github.com/cjtheham/hugo-theme-readable/tree/main/layouts) - * [Website](https://ww0cj.radio/) - * Fediverse - * [@roguefoam@alpha.polymaths.social](https://alpha.polymaths.social/@roguefoam) -3) Sire for making me laugh - * Fediverse - * [@sire@alpha.polymaths.social](https://alpha.polymaths.social/@sire) -4) Tyil for teaching me a few things - * [Website](https://www.tyil.nl) - * [Fediverse](https://fedi.tyil.nl/@tyil) -5) R.L Dane for being around - * [Blog](https://rldane.space/) - * Fediverse - * [@RL_Dane@fosstodon.org](https://fosstodon.org/@RL_Dane) -8) Orbital Martian for being around - * [Blog](https://orbitalmartian.codeberg.page/) - * Fediverse - * [@orbitalmartian@alpha.polymaths.social](https://alpha.polymaths.social/@orbitalmartian) -9) Sotolf for being around - * Fediverse - * [@sotolf@alpha.polymaths.social](https://alpha.polymaths.social/@sotolf) - * [@sotolf@social.linux.pizza](https://social.linux.pizza/@sotolf) -10) Ivan for being around - * [Website](https://vmst.io/@libreivan) - * Fediverse - * [@libreivan@vmst.io](https://vmst.io/@libreivan) - * [@ivan@alpha.polymaths.social](https://alpha.polymaths.social/@ivan) -11) Krafter +{{}} diff --git a/content/test.md b/content/test.md deleted file mode 100644 index 07923d1..0000000 --- a/content/test.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "A List of People" -date: 2024-05-22T20:21:36-05:00 -draft: true -tags: - - info ---- -{{}} diff --git a/data/people.xml b/data/people.xml new file mode 100644 index 0000000..27ac8af --- /dev/null +++ b/data/people.xml @@ -0,0 +1,42 @@ + + + + Benjamin Hollon + For his work on [readable.css](https://readable-css.freedomtowrite.org/) + benjaminhollon.com + [@amin@alpha.polymaths.social](https://alpha.polymaths.social/@amin) + [codeberg.org/benjaminhollon](https://codeberg.org/benjaminhollon) + [Github](https://github.com/benjaminbhollon) (Dead) + [benjaminhollon.com/social](https://benjaminhollon.com/social/) + [benjaminhollon.com/contact](https://benjaminhollon.com/contact) + + + C.J + his work on [hugo-theme-readable](https://github.com/cjtheham/hugo-theme-readable/tree/main/layouts) + ww0cj.radio + [@roguefoam@alpha.polymaths.social](https://alpha.polymaths.social) + + + Sire + making me laugh + [@sire@alpha.polymaths.social](@alpha.polymaths.social/@sire] + + + Orbital Martian + Being cool + orbitalmartian.gitlab.io + [@orbitalmartian@alpha.polymaths.social](https://alpha.polymaths.social/@orbitalmartian) + + + Sotolf + [@sotolf@alpha.polymaths.social](https://alpha.polymaths.social/@sotolf) + [@sotolf@social.linux.pizza](https://social.linux.pizza/@sotolf) + + + Ivan + being cool + libreivan.com + [@libreivan@vmst.io](https://vmst.io/@libreivan) + [@ivan@alpha.polymaths.social](https://alpha.polymaths.social/@ivan) + + diff --git a/hugo.toml b/hugo.toml index d88df9f..a473e0e 100644 --- a/hugo.toml +++ b/hugo.toml @@ -30,9 +30,15 @@ enableGitInfo= "true" name = "About" url = "/about/" weight = 3 + [[menu.main]] + identifier = "People" + name = "People" + url = "/people/" + weight = 4 + [[menu.main]] identifier = "tags" name = "Tags" url = "/tags/" - weight = 4 + weight = 5 diff --git a/layouts/shortcodes/peoplelist.html b/layouts/shortcodes/peoplelist.html index b41486d..258b22b 100644 --- a/layouts/shortcodes/peoplelist.html +++ b/layouts/shortcodes/peoplelist.html @@ -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 }}
    -
  • {{ .Website }}
    • - + {{ with .website }}
    • Website: {{ . }}
    • {{ end }} + {{ range $key, $value := . }} + {{ if eq $key "why" "name" "website" }} + {{ continue }} + {{ end }} +
    • {{ replaceRE "1" "$1" $key | humanize }}: {{ $value | markdownify }}
    • + {{ end }} +
    {{ end }}