Bump Hugo version

This commit is contained in:
JP Hastings-Spital 2025-05-22 17:34:58 +01:00
parent 3c65a9a98c
commit d8d34a5e88
9 changed files with 39 additions and 27 deletions

View file

@ -30,9 +30,9 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.140.2
HUGO_VERSION: 0.147.4
PAGEFIND_VERSION: 1.3.0
TASK_VERSION: 3.40.1
TASK_VERSION: 3.43.3
steps:
- name: Install Hugo CLI
run: |

View file

@ -8,7 +8,7 @@
</head>
<body>
{{ range .Pages -}}
<outline {{ if .Date }}created="{{ .Date.Format "02 Jan 2006 15:04 MST" }}" {{ end }}title="{{ .Title }}" text="{{ .Title }}" type="rss" xmlUrl="{{ (.OutputFormats.Get "rss").Permalink }}" htmlUrl="{{ .Permalink }}" description="{{ .Summary }}"/>
<outline {{ if .Date }}created="{{ .Date.Format "02 Jan 2006 15:04 MST" }}" {{ end }}title="{{ .Title }}" text="{{ .Title }}" type="rss"{{ with .OutputFormats.Get "rss"}} xmlUrl="{{ .Permalink }}"{{ end }} htmlUrl="{{ .Permalink }}" description="{{ .Summary }}"/>
{{ end -}}
</body>
</opml>

View file

@ -6,14 +6,16 @@
{{- partialCached "svg.html" (dict "name" $style) $style -}}
{{- $url := printf "https://%s" site.Params.clapsHost -}}
{{- $cacheKey := print $url (now.Format "-2006-01-02-15") -}}
{{- with resources.GetRemote $url (dict "key" $cacheKey) -}}
{{- with try (resources.GetRemote $url (dict "key" $cacheKey)) -}}
{{- with .Err -}}
{{- errorf "%s" . -}}
{{- else -}}
{{ else with .Value }}
{{- $data := .Content | transform.Unmarshal -}}
{{- $clapCount := (index $data $relperma) | default 0 -}}
{{- $totalCount := add (int $interactionCount) (int $clapCount) -}}
{{- with $totalCount }}<span>{{ . }}</span>{{ end -}}
{{ else }}
{{ errorf "Unable to get remote resource %q" $url }}
{{- end -}}
{{- else -}}
{{- errorf "Unable to get all clap counts" -}}

View file

@ -40,7 +40,7 @@
{{- $count := len $items -}}
{{- if gt $count 0 -}}
<li>
{{ partial "partials/reactionsvg.html" (dict "emoji" $thisEm) }}
{{ template "partials/reactionsvg.html" (dict "emoji" $thisEm) }}
{{ $count }}
</li>
{{ end }}
@ -63,7 +63,7 @@
{{- range $thisEm, $items := $interactionMap -}}
{{- if ne $thisEm "💬" -}}
<li>
{{ partial "partials/reactionsvg.html" (dict "emoji" $thisEm "name" true) -}}
{{ template "partials/reactionsvg.html" (dict "emoji" $thisEm "name" true) -}}
{{- range $i, $in := $items -}}
<a href="{{ $in.url | default $in.author.url }}" target="_blank">{{ $in.author.name | replaceRE `(\?\x{200D}?){2,}` "" | strings.TrimSpace }}</a>
{{- if ne $i (sub (len $items) 1) }}, {{ end -}}

View file

@ -14,14 +14,16 @@
{{- if not $key -}}
{{- $query := (dict "type" "/type/edition" "isbn_13" $isbn) | jsonify -}}
{{- with resources.GetRemote (printf "https://openlibrary.org/api/things?query=%s" ($query)) -}}
{{- with try (resources.GetRemote (printf "https://openlibrary.org/api/things?query=%s" ($query))) -}}
{{- with .Err -}}
{{- errorf "Error grabbing Thing from OpenLibrary: %v" . -}}
{{- else -}}
{{- else with .Value -}}
{{- $thing := .Content | transform.Unmarshal -}}
{{- if and (eq $thing.status "ok") (ge (len $thing.result) 1) -}}
{{- $key = index $thing.result 0 -}}
{{- end -}}
{{- else -}}
{{- errorf "Error grabbing Thing from OpenLibrary" -}}
{{- end -}}
{{- else -}}
{{- errorf "Failed to fetch ISBN data from OpenLibrary: %s" $isbn -}}
@ -29,26 +31,28 @@
{{- end -}}
{{- if $key -}}
{{- with resources.GetRemote (printf "https://openlibrary.org/api/get?key=%s" $key) -}}
{{- with try (resources.GetRemote (printf "https://openlibrary.org/api/get?key=%s" $key)) -}}
{{- with .Err -}}
{{- errorf "Error grabbing Book data from OpenLibrary: %v" . -}}
{{- else -}}
{{- else with .Value -}}
{{- $bookObj := .Content | transform.Unmarshal -}}
{{- if eq $bookObj.status "ok" -}}
{{- $isbn = index $bookObj.result.isbn_13 0 -}}
{{- $authors := slice -}}
{{- range $bookObj.result.authors -}}
{{- with resources.GetRemote (printf "https://openlibrary.org/api/get?key=%s" .key) -}}
{{- with try (resources.GetRemote (printf "https://openlibrary.org/api/get?key=%s" .key)) -}}
{{- with .Err -}}
{{- errorf "Error grabbing Author data from OpenLibrary: %v" . -}}
{{- else -}}
{{- else with .Value -}}
{{- $authorObj := .Content | transform.Unmarshal -}}
{{- if eq $authorObj.status "ok" -}}
{{- $authors = $authors | append (dict "name" $authorObj.result.name "url" (printf "https://openlibrary.org%s" $authorObj.result.key)) -}}
{{- else -}}
{{- errorf "OpenLibrary response was %s while fetching author data: %s" $authorObj.status .key -}}
{{- end -}}
{{- else -}}
{{- errorf "Error grabbing Author data from OpenLibrary" -}}
{{- end -}}
{{- else -}}
{{- warnf "Failed to fetch Author data from OpenLibrary: %s" .key -}}
@ -64,9 +68,9 @@
{{- $bookFilename := replaceRE `[^a-z]+` "-" (lower $bookObj.result.title) -}}
{{- $coverPath := replaceRE `(\.md)?$` (printf "/%s.jpg" $bookFilename) $path -}}
{{- with resources.GetRemote $coverURL -}}
{{- with try (resources.GetRemote $coverURL) -}}
{{- with .Err -}}
{{- else -}}
{{- else with .Value -}}
{{- $cover = .Content | resources.FromString $coverPath -}}
{{- end -}}
{{- end -}}
@ -76,6 +80,8 @@
{{- else -}}
{{- errorf "OpenLibrary response was %s while fetching: %s" $bookObj $key -}}
{{- end -}}
{{- else -}}
{{- errorf "Error grabbing Book data from OpenLibrary" -}}
{{- end -}}
{{- else -}}
{{- errorf "Failed to fetch Book data data from OpenLibrary: %s" $key -}}

View file

@ -8,7 +8,7 @@
{{- if $ref -}}
Comments on '{{ $ref.name }}'
{{- else -}}
{{- partial "partials/fallback-title.txt" . -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}
{{- else if .Params.likeOf -}}
{{- $ref := partial "reference.obj" (dict "url" .Params.likeOf "references" .Params.references) -}}
@ -16,11 +16,11 @@
{{- with index (split $ref.name "|" | first 1) 0 -}}
{{- . -}}
{{- else -}}
{{- partial "partials/fallback-title.txt" . -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}
{{- else -}}
{{- partial "partials/fallback-title.txt" . -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}
{{- else -}}
{{- partial "partials/fallback-title.txt" . -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}

View file

@ -26,11 +26,11 @@
<figcaption>
<cite><a href="{{ .url }}" target="_blank" title="Open book details" itemprop="url"><span itemprop="name">{{ .title }}</span></a></cite>
{{- partial "partials/author-list.html" .authors -}}
{{- template "partials/author-list.html" .authors -}}
</figcaption>
</figure>
{{- else -}}
<cite><a href="{{ .url }}" target="_blank" title="Open book details" itemprop="name">{{ .title }}</a></cite>
{{- partial "partials/author-list.html" .authors -}}
{{- template "partials/author-list.html" .authors -}}
{{- end -}}
{{- end -}}

View file

@ -1,10 +1,10 @@
{{- $count := .Get 0 | default 5 -}}
{{- $url := printf "https://%s" site.Params.clapsHost -}}
{{- $cacheKey := print $url (now.Format "-2006-01-02-15") -}}
{{- with resources.GetRemote $url (dict "key" $cacheKey) -}}
{{- with try (resources.GetRemote $url (dict "key" $cacheKey)) -}}
{{- with .Err -}}
{{- errorf "%s" . -}}
{{- else -}}
{{- errorf "Unable to get top claps: %v" . -}}
{{- else with .Value -}}
{{- $data := .Content | transform.Unmarshal -}}
{{- $claps := slice -}}
{{- range $path, $count := $data -}}
@ -17,6 +17,8 @@
=> {{.RelPermalink}} {{ with .Params.emoji }}{{ . }} {{ end}}{{ with .Title -}}{{ . }}{{ else }}{{ .Type | singularize | title }}{{ end }} ({{ $count }})
{{- end -}}
{{- end }}
{{- else -}}
{{- errorf "Unable to get top claps" -}}
{{- end -}}
{{- else -}}
{{- errorf "Unable to get all clap counts" -}}

View file

@ -1,10 +1,10 @@
{{- $count := .Get 0 | default 5 -}}
{{- $url := printf "https://%s" site.Params.clapsHost -}}
{{- $cacheKey := print $url (now.Format "-2006-01-02-15") -}}
{{- with resources.GetRemote $url (dict "key" $cacheKey) -}}
{{- with try (resources.GetRemote $url (dict "key" $cacheKey)) -}}
{{- with .Err -}}
{{- errorf "%s" . -}}
{{- else -}}
{{- errorf "Unable to get top claps: %v" . -}}
{{- else with .Value -}}
{{- $data := .Content | transform.Unmarshal -}}
{{- $claps := slice -}}
{{- range $path, $count := $data -}}
@ -37,6 +37,8 @@
}
}
</script>
{{- else -}}
{{- errorf "Unable to get top claps" -}}
{{- end -}}
{{- else -}}
{{- errorf "Unable to get all clap counts" -}}