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: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: 0.140.2 HUGO_VERSION: 0.147.4
PAGEFIND_VERSION: 1.3.0 PAGEFIND_VERSION: 1.3.0
TASK_VERSION: 3.40.1 TASK_VERSION: 3.43.3
steps: steps:
- name: Install Hugo CLI - name: Install Hugo CLI
run: | run: |

View file

@ -8,7 +8,7 @@
</head> </head>
<body> <body>
{{ range .Pages -}} {{ 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 -}} {{ end -}}
</body> </body>
</opml> </opml>

View file

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

View file

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

View file

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

View file

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

View file

@ -26,11 +26,11 @@
<figcaption> <figcaption>
<cite><a href="{{ .url }}" target="_blank" title="Open book details" itemprop="url"><span itemprop="name">{{ .title }}</span></a></cite> <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> </figcaption>
</figure> </figure>
{{- else -}} {{- else -}}
<cite><a href="{{ .url }}" target="_blank" title="Open book details" itemprop="name">{{ .title }}</a></cite> <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 -}}
{{- end -}} {{- end -}}

View file

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

View file

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