From 395ebb0d766c6711d1fd7bfa56b6a77a20fb0325 Mon Sep 17 00:00:00 2001 From: Josh Aas Date: Sat, 5 Sep 2026 15:28:07 -0400 Subject: [PATCH] Clean up social tags --- themes/le-2025/layouts/partials/head.html | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/themes/le-2025/layouts/partials/head.html b/themes/le-2025/layouts/partials/head.html index 7ab95294a..597315a80 100644 --- a/themes/le-2025/layouts/partials/head.html +++ b/themes/le-2025/layouts/partials/head.html @@ -4,17 +4,24 @@ {{ if ne .Title .Site.Title }}{{ .Title }} - {{ end }} {{ .Site.Title }} - +{{- /* Description for the meta tag and the Open Graph card: the page's + description, else its summary, else the site description. */ -}} +{{ $description := "" -}} +{{ if .Description }}{{ $description = .Description }}{{ else if .IsPage }}{{ $description = .Summary }}{{ else }}{{ $description = site.Params.description | default "" }}{{ end -}} +{{ $description = $description | plainify | htmlUnescape | replaceRE "\\s+" " " | strings.TrimSpace }} + - - +{{/* Open Graph is what link previews read (Mastodon, Bluesky, LinkedIn, + Facebook, Slack, and X, which falls back to it), so it is the only set of + social tags we emit. */ -}} + + - + - - - - + + + {{ with site.Home.OutputFormats.Get "RSS" -}} {{- end }}