From 9743a7ec287f81be01afb1c6276c771d9782e76e Mon Sep 17 00:00:00 2001 From: Sven Dahlstrand Date: Thu, 2 Apr 2026 01:25:06 +0200 Subject: [PATCH 1/4] Use .Site.Params.author for Hugo 0.158 compatibility. --- layouts/_default/list.json.json | 2 +- layouts/_default/rss.xml | 2 +- layouts/index.json | 2 +- layouts/index.xml | 2 +- layouts/list.archivejson.json | 2 +- layouts/list.photosjson.json | 2 +- layouts/list.podcastjson.json | 2 +- layouts/list.podcastxml.xml | 2 +- layouts/newsletter.html | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json index a0fea3b..c3ddf00 100644 --- a/layouts/_default/list.json.json +++ b/layouts/_default/list.json.json @@ -1,7 +1,7 @@ { "version": "https://jsonfeed.org/version/1", "title": {{ if eq .Title .Site.Title }}{{ .Site.Title | jsonify }}{{ else }}{{ printf `%s on %s` .Title .Site.Title | jsonify }}{{ end }}, - "icon": "{{ .Site.Author.avatar }}", + "icon": "{{ .Site.Params.author.avatar }}", "home_page_url": "{{ .Site.BaseURL }}", "feed_url": "{{ .Site.BaseURL }}feed.json", "items": [ diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 245f835..9e0e677 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -12,7 +12,7 @@ {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Params.author.email }}{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}{{end}} {{- if .Params.guid }} {{ .Params.guid }} {{- else -}} diff --git a/layouts/index.json b/layouts/index.json index 478be43..04c675c 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,7 +1,7 @@ { "version": "https://jsonfeed.org/version/1", "title": {{ .Site.Title | jsonify }}, - "icon": "{{ .Site.Author.avatar }}", + "icon": "{{ .Site.Params.author.avatar }}", "home_page_url": "{{ .Site.BaseURL }}", "feed_url": "{{ .Site.BaseURL }}feed.json", "items": [ diff --git a/layouts/index.xml b/layouts/index.xml index 1927728..c7e0d91 100644 --- a/layouts/index.xml +++ b/layouts/index.xml @@ -13,7 +13,7 @@ {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Params.author.email }}{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}{{end}} {{- if .Params.guid }} {{ .Params.guid }} {{- else -}} diff --git a/layouts/list.archivejson.json b/layouts/list.archivejson.json index 970300d..e3ddcbb 100644 --- a/layouts/list.archivejson.json +++ b/layouts/list.archivejson.json @@ -1,7 +1,7 @@ { "version": "https://jsonfeed.org/version/1", "title": {{ .Site.Title | jsonify }}, - "icon": "{{ .Site.Author.avatar }}", + "icon": "{{ .Site.Params.author.avatar }}", "home_page_url": "{{ .Site.BaseURL }}", "feed_url": "{{ .Site.BaseURL }}photos/index.json", "items": [ diff --git a/layouts/list.photosjson.json b/layouts/list.photosjson.json index c1a4665..247efce 100644 --- a/layouts/list.photosjson.json +++ b/layouts/list.photosjson.json @@ -1,7 +1,7 @@ { "version": "https://jsonfeed.org/version/1", "title": {{ .Site.Title | jsonify }}, - "icon": "{{ .Site.Author.avatar }}", + "icon": "{{ .Site.Params.author.avatar }}", "home_page_url": "{{ .Site.BaseURL }}", "feed_url": "{{ .Site.BaseURL }}photos/index.json", "items": [ diff --git a/layouts/list.podcastjson.json b/layouts/list.podcastjson.json index de06b07..d488e71 100644 --- a/layouts/list.podcastjson.json +++ b/layouts/list.podcastjson.json @@ -1,7 +1,7 @@ { "version": "https://jsonfeed.org/version/1", "title": {{ .Site.Title | jsonify }}, - "icon": "{{ .Site.Author.avatar }}", + "icon": "{{ .Site.Params.author.avatar }}", "home_page_url": "{{ .Site.BaseURL }}", "feed_url": "{{ .Site.BaseURL }}podcast.json", "_podcast": { diff --git a/layouts/list.podcastxml.xml b/layouts/list.podcastxml.xml index 15c3b2e..23b782f 100644 --- a/layouts/list.podcastxml.xml +++ b/layouts/list.podcastxml.xml @@ -26,7 +26,7 @@ {{ .Title | htmlEscape }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{ . | htmlEscape}}{{ with $.Site.Author.name }} ({{ . | htmlEscape}}){{end}}{{end}} + {{ with .Site.Params.author.email }}{{ . | htmlEscape}}{{ with $.Site.Params.author.name }} ({{ . | htmlEscape}}){{end}}{{end}} {{ .Permalink }} {{ range first 1 .Params.audio_with_metadata }} diff --git a/layouts/newsletter.html b/layouts/newsletter.html index 0632525..02e2c78 100644 --- a/layouts/newsletter.html +++ b/layouts/newsletter.html @@ -14,7 +14,7 @@

- Profile icon + Profile icon {{ .Site.Title }} — Unsubscribe From 982806dba99b3991834b6c0a7b010084d6b98cec Mon Sep 17 00:00:00 2001 From: Sven Dahlstrand Date: Thu, 2 Apr 2026 01:27:53 +0200 Subject: [PATCH 2/4] Make sure to plainify .Summary. .Summary contains HTML since a breaking change in Hugo 0.134. https://github.com/gohugoio/hugo/releases/tag/v0.134.0 --- layouts/_default/list.archivehtml.html | 2 +- layouts/list.archivehtml.html | 2 +- layouts/list.archivejson.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/list.archivehtml.html b/layouts/_default/list.archivehtml.html index 90d9b65..d4da827 100644 --- a/layouts/_default/list.archivehtml.html +++ b/layouts/_default/list.archivehtml.html @@ -18,7 +18,7 @@ {{ if .Title }} {{ .Title }} {{ end }} - {{ .Summary | truncate 100 }} + {{ .Summary | plainify | truncate 100 }}

{{ end }} diff --git a/layouts/list.archivehtml.html b/layouts/list.archivehtml.html index 90d9b65..d4da827 100644 --- a/layouts/list.archivehtml.html +++ b/layouts/list.archivehtml.html @@ -18,7 +18,7 @@ {{ if .Title }} {{ .Title }} {{ end }} - {{ .Summary | truncate 100 }} + {{ .Summary | plainify | truncate 100 }}

{{ end }} diff --git a/layouts/list.archivejson.json b/layouts/list.archivejson.json index e3ddcbb..ffa202b 100644 --- a/layouts/list.archivejson.json +++ b/layouts/list.archivejson.json @@ -11,7 +11,7 @@ { "id": "{{ .Permalink }}", "title": {{ .Title | jsonify }}, - "content_text": {{ .Summary | truncate 100 | jsonify }}, + "content_text": {{ .Summary | plainify | truncate 100 | jsonify }}, "date_published": "{{ .Date.Format "2006-01-02T15:04:05-07:00" }}", "url": "{{ .Permalink }}" } From 2f18656af65d8edbaed57032ba14ab028efe2133 Mon Sep 17 00:00:00 2001 From: Sven Dahlstrand Date: Thu, 2 Apr 2026 01:50:25 +0200 Subject: [PATCH 3/4] Unescape .Summary for Hugo 0.91 compatibility. --- layouts/_default/list.archivehtml.html | 2 +- layouts/index.json | 2 +- layouts/list.archivehtml.html | 2 +- layouts/list.archivejson.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/list.archivehtml.html b/layouts/_default/list.archivehtml.html index d4da827..7384756 100644 --- a/layouts/_default/list.archivehtml.html +++ b/layouts/_default/list.archivehtml.html @@ -18,7 +18,7 @@ {{ if .Title }} {{ .Title }} {{ end }} - {{ .Summary | plainify | truncate 100 }} + {{ .Summary | plainify | htmlUnescape | truncate 100 }}

{{ end }} diff --git a/layouts/index.json b/layouts/index.json index 04c675c..e30c605 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -22,7 +22,7 @@ {{- $s := replace $s "\\u003e" ">" -}} {{- $s := replace $s "\\u0026" "&" }} "content_html": {{ $s }}, - {{ if .Params.custom_summary }}"summary": {{ .Summary | plainify | jsonify }},{{ end }} + {{ if .Params.custom_summary }}"summary": {{ .Summary | plainify | htmlUnescape | jsonify }},{{ end }} "date_published": "{{ .Date.Format "2006-01-02T15:04:05-07:00" }}", "url": "{{ .Permalink }}" {{- with .Params.categories -}} diff --git a/layouts/list.archivehtml.html b/layouts/list.archivehtml.html index d4da827..7384756 100644 --- a/layouts/list.archivehtml.html +++ b/layouts/list.archivehtml.html @@ -18,7 +18,7 @@ {{ if .Title }} {{ .Title }} {{ end }} - {{ .Summary | plainify | truncate 100 }} + {{ .Summary | plainify | htmlUnescape | truncate 100 }}

{{ end }} diff --git a/layouts/list.archivejson.json b/layouts/list.archivejson.json index ffa202b..688e481 100644 --- a/layouts/list.archivejson.json +++ b/layouts/list.archivejson.json @@ -11,7 +11,7 @@ { "id": "{{ .Permalink }}", "title": {{ .Title | jsonify }}, - "content_text": {{ .Summary | plainify | truncate 100 | jsonify }}, + "content_text": {{ .Summary | plainify | htmlUnescape | truncate 100 | jsonify }}, "date_published": "{{ .Date.Format "2006-01-02T15:04:05-07:00" }}", "url": "{{ .Permalink }}" } From ed40e1c87d6220c9fee1920901f17c88e92ee0a3 Mon Sep 17 00:00:00 2001 From: Sven Dahlstrand Date: Tue, 5 May 2026 14:20:47 +0200 Subject: [PATCH 4/4] Add basic Open Graph metadata. Must be enabled via .Site.Params.opengraph_is_enabled. --- layouts/partials/microblog_head.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/layouts/partials/microblog_head.html b/layouts/partials/microblog_head.html index b3ed062..865e4f5 100644 --- a/layouts/partials/microblog_head.html +++ b/layouts/partials/microblog_head.html @@ -26,6 +26,30 @@ {{ end }} +{{ if .Site.Params.opengraph_is_enabled }} + {{ if .IsHome }} + + + + {{ else }} + + + {{ if .Params.photos }} + {{- range .Params.photos -}} + + {{- end -}} + {{ else }} + {{ with .Params.opengraph.image }} + + {{ end }} + {{ end }} + {{- end -}} + + + + +{{ end }} +