Update to Hugo v0.143.1

This commit is contained in:
Brandon Rozek 2025-02-16 11:03:28 -05:00
parent 615e03bca3
commit 525b28e98b
No known key found for this signature in database
GPG key ID: DFB0E78F805F4567
13 changed files with 36 additions and 49 deletions

View file

@ -3,7 +3,7 @@
"url": "{{ .Permalink }}", "url": "{{ .Permalink }}",
"title": {{ .Title | jsonify }}, "title": {{ .Title | jsonify }},
"authors": [ "authors": [
{{with $.Site.Author.name }} {{with $.Site.Params.Author }}
{ "name": "{{ . }}" } { "name": "{{ . }}" }
{{ end }} {{ end }}
], ],

View file

@ -3,14 +3,14 @@
{ {
"@context": "https://www.w3.org/ns/activitystreams", "@context": "https://www.w3.org/ns/activitystreams",
"actor": { "actor": {
{{with $.Site.Author.name }}"name": "{{ . }}",{{ end }} {{with $.Site.Params.Author }}"name": "{{ . }}",{{ end }}
"url": "{{ .Site.BaseURL }}" "url": "{{ .Site.BaseURL }}"
}, },
"id": "{{ $page.Permalink }}", "id": "{{ $page.Permalink }}",
"object": { "object": {
"attributedTo": [ "attributedTo": [
{ {
{{with $.Site.Author.name }}"name": "{{ . }}",{{ end }} {{with $.Site.Params.Author }}"name": "{{ . }}",{{ end }}
"type": "Person", "type": "Person",
"url": "{{ .Site.BaseURL }}" "url": "{{ .Site.BaseURL }}"
} }

View file

@ -18,7 +18,7 @@
<generator uri="https://gohugo.io">Hugo</generator> <generator uri="https://gohugo.io">Hugo</generator>
<author> <author>
<uri>{{ .Site.BaseURL }}</uri> <uri>{{ .Site.BaseURL }}</uri>
{{ with .Site.Author.name }}<name>{{.}}</name>{{end}} {{ with .Site.Params.Author }}<name>{{.}}</name>{{end}}
</author> </author>
<updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> <updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ with .OutputFormats.Get "Atom" }} {{ with .OutputFormats.Get "Atom" }}
@ -29,7 +29,7 @@
<author> <author>
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<uri>{{ .Site.BaseURL }}</uri> <uri>{{ .Site.BaseURL }}</uri>
{{ with .Site.Author.name }}<name>{{.}}</name>{{end}} {{ with .Site.Params.Author }}<name>{{.}}</name>{{end}}
</author> </author>
<activity:object-type>http://activitystrea.ms/schema/1.0/article</activity:object-type> <activity:object-type>http://activitystrea.ms/schema/1.0/article</activity:object-type>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>

View file

@ -7,7 +7,7 @@
"icon": "{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}", "icon": "{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}",
"language": "en-US", "language": "en-US",
"authors": [ "authors": [
{{with $.Site.Author.name }} {{with $.Site.Params.Author }}
{ "name": "{{ . }}" } { "name": "{{ . }}" }
{{ end }} {{ end }}
], ],

View file

@ -21,9 +21,9 @@
</image> </image>
<description>{{ .Description }}</description> <description>{{ .Description }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }} <language>{{.}}</language>{{end}}{{ with .Site.Params.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} <managingEditor>{{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} <webMaster>{{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }} {{ with .OutputFormats.Get "RSS" }}
@ -34,7 +34,7 @@
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} {{ with .Site.Params.email }}<author>{{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid> <guid>{{ .Permalink }}</guid>
{{ printf `<description><![CDATA[%s]]></description>` .Summary | safeHTML }} {{ printf `<description><![CDATA[%s]]></description>` .Summary | safeHTML }}
{{ printf `<content:encoded><![CDATA[%s]]></content:encoded>` .Content | safeHTML }} {{ printf `<content:encoded><![CDATA[%s]]></content:encoded>` .Content | safeHTML }}

View file

@ -10,7 +10,7 @@
{{ range last 1 $posts }} {{ range last 1 $posts }}
{{ $tags := .Site.Taxonomies.tags }} {{ $tags := .Site.Taxonomies.tags }}
<div class='bloglist-teaser block-center'> <div class='bloglist-teaser block-center'>
Hello! This page contains <strong>{{ $postCount | lang.NumFmt 0 }} posts</strong> Hello! This page contains <strong>{{ $postCount | lang.FormatNumber 0 }} posts</strong>
written in the past <strong>{{ div (sub now.Unix .Date.Unix) 31536000 }} years</strong> written in the past <strong>{{ div (sub now.Unix .Date.Unix) 31536000 }} years</strong>
spanning spanning
{{ len $tags }} topics within the dropdown above. {{ len $tags }} topics within the dropdown above.

View file

@ -14,7 +14,7 @@
{{ end }} {{ end }}
{{ $tags := .Site.Taxonomies.tags }} {{ $tags := .Site.Taxonomies.tags }}
<div style="text-align: center; margin-bottom: 2rem;" class='bloglist-teaser block-center'> <div style="text-align: center; margin-bottom: 2rem;" class='bloglist-teaser block-center'>
Hello! This page contains {{ $postCount | lang.NumFmt 0 }} observations, Hello! This page contains {{ $postCount | lang.FormatNumber 0 }} observations,
{{ len $tags }} of which are <strong><a href="https://www.inaturalist.org/posts/39072-research-grade">research grade</a></strong>. {{ len $tags }} of which are <strong><a href="https://www.inaturalist.org/posts/39072-research-grade">research grade</a></strong>.
</div> </div>
{{ end }} {{ end }}

View file

@ -1,30 +0,0 @@
<!-- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html -->
{{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ index . 0 | absURL }}">
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ $featured.Permalink }}">
{{- else -}}
{{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ index . 0 | absURL }}">
{{ else -}}
<meta name="twitter:card" content="summary">
{{- end -}}
{{- end -}}
{{- end }}
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">
{{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}">
{{ end -}}
{{ range .Site.Authors }}
{{ with .twitter -}}
<meta name="twitter:creator" content="@{{ . }}">
{{ end -}}
{{ end -}}

View file

@ -57,7 +57,6 @@
{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} {{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}}
{{- template "_internal/opengraph.html" . -}} {{- template "_internal/opengraph.html" . -}}
{{- template "_internal/schema.html" . -}} {{- template "_internal/schema.html" . -}}
{{- partial "external/twitter_cards.html" . -}}
{{ partial "citation.html" . }} {{ partial "citation.html" . }}

View file

@ -62,7 +62,6 @@
{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} {{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}}
{{- template "_internal/opengraph.html" . -}} {{- template "_internal/opengraph.html" . -}}
{{- template "_internal/schema.html" . -}} {{- template "_internal/schema.html" . -}}
{{- partial "external/twitter_cards.html" . -}}
{{ partial "citation.html" . }} {{ partial "citation.html" . }}

View file

@ -1,7 +1,17 @@
{{ $url := urls.Parse (.Get 0) }} {{ $url := urls.Parse (.Get 0) }}
{{ $status_id := index (last 1 (split $url.Path "/")) 0 }} {{ $status_id := index (last 1 (split $url.Path "/")) 0 }}
{{ $api_url := printf "%s://%s/api/v1/statuses/%s" $url.Scheme $url.Host $status_id }} {{ $api_url := printf "%s://%s/api/v1/statuses/%s" $url.Scheme $url.Host $status_id }}
{{ $dataJ := getJSON $api_url }} {{ $dataJ := dict }}
{{ $url := $api_url }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "Unable to get remote resource %s: %s" $url . }}
{{ else with .Value }}
{{ $dataJ = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %s" $url }}
{{ end }}
{{ end }}
{{ .Scratch.Set "toot" $dataJ }} {{ .Scratch.Set "toot" $dataJ }}
{{ partial "external/toot.html" . }} {{ partial "external/toot.html" . }}

View file

@ -1,6 +1,15 @@
{{ $toot_reference := .Get 0 }} {{ $toot_reference := .Get 0 }}
{{ $url := printf "static/data/toots/%s.json" $toot_reference }} {{ $url := printf "data/toots/%s.json" $toot_reference }}
{{ $dataJ := getJSON $url }} {{ $dataJ := dict }}
{{ with try (resources.Get $url) }}
{{ with .Err }}
{{ errorf "Unable to get resource %s: %s" $url . }}
{{ else with .Value }}
{{ $dataJ = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get resource %s" $url }}
{{ end }}
{{ end }}
w
{{ .Scratch.Set "toot" $dataJ }} {{ .Scratch.Set "toot" $dataJ }}
{{ partial "external/toot.html" . }} {{ partial "external/toot.html" . }}

View file

@ -2,7 +2,7 @@
{{ partial "header.html" . }} {{ partial "header.html" . }}
<main> <main>
<div class='bloglist-teaser block-center' style="margin-top: 2rem;"> <div class='bloglist-teaser block-center' style="margin-top: 2rem;">
Here you'll find <strong>{{ len .Pages | lang.NumFmt 0 }} posts</strong> Here you'll find <strong>{{ len .Pages | lang.FormatNumber 0 }} posts</strong>
about <u>{{ .Title }}</u> </strong>. about <u>{{ .Title }}</u> </strong>.
</div> </div>
<!-- contents --> <!-- contents -->