add old artwork, fix art stats not being sorted

This commit is contained in:
Joshua Goins 2024-10-03 21:50:12 -04:00
parent 08b3849fed
commit 9fd52cc214
3 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,5 @@
{
"date": "2023-11-25",
"program": "Krita",
"title": "three legs"
}

View file

@ -0,0 +1,5 @@
{
"date": "2024-04-24",
"program": "Krita",
"title": "Awkward"
}

View file

@ -19,10 +19,15 @@
{{ $.Scratch.Set "header-name" "# of Artworks by Year" }} {{ $.Scratch.Set "header-name" "# of Artworks by Year" }}
{{ partial "fake-heading.html" $ }} {{ partial "fake-heading.html" $ }}
<ol> <ol>
{{ range (where .Site.RegularPages "Section" "=" "art").GroupByDate "2006" }} {{ $years := (where .Site.RegularPages "Section" "=" "art").GroupByDate "2006" }}
{{ $year_sorted := slice }}
{{ range $years }}
{{ $year := .Key }} {{ $year := .Key }}
{{ $num := len (where .Pages "Params.guest" "=" false) }} {{ $num := len (where .Pages "Params.guest" "=" false) }}
<li><a href="/art/{{ $year }}">{{ $year }}</a> ({{ $num }} artworks)</li> {{ $year_sorted = $year_sorted | append (dict "year" $year "num" $num) }}
{{ end }}
{{ range (sort $year_sorted "num" "desc") }}
<li><a href="/art/{{ .year }}">{{ .year }}</a> ({{ .num }} artworks)</li>
{{ end }} {{ end }}
</ol> </ol>
{{ end }} {{ end }}