From cba4822d89f21aecc1c0484df2c254a6c7d07bb1 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Wed, 19 Jun 2024 22:30:07 +0100 Subject: [PATCH] Tweaks for gemini and opensearch --- layouts/_default/rss.xml | 1 + layouts/index.gmi | 3 +-- layouts/partials/latest-non-reply-note.obj | 11 +++++++++++ layouts/partials/post-previews.html | 12 +----------- static/opensearch.xml | 3 +++ 5 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 layouts/partials/latest-non-reply-note.obj diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 8085ab2b..d92d4b79 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -24,6 +24,7 @@ {{- with .OutputFormats.Get "RSS" -}} {{ printf "" (.Permalink | absURL) .MediaType | safeHTML }} {{- end -}} + {{ printf "" }} {{- range $i, $page := $pages -}} {{- if $page.Params.inReplyTo -}}{{ continue }}{{- end -}} diff --git a/layouts/index.gmi b/layouts/index.gmi index 8eb2e336..da915797 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -38,8 +38,7 @@ Get in touch if you'd like to go to these, or any other events⁺, together! => /calendar/ 🗓️ My events calendar {{ end }} -{{ $notePage := index (where .Site.RegularPages "Section" "eq" "notes") 0 -}} -{{ with $notePage }}## A recent note +{{ with (partial "latest-non-reply-note.obj") }}## A recent note 📅 {{ .Page.Date.Format "January 2, 2006 — 15:04 (MST)" }} {{ trim (partial "markdown.gmi" .Page.RenderShortcodes) "\r\n " }}{{ end }} diff --git a/layouts/partials/latest-non-reply-note.obj b/layouts/partials/latest-non-reply-note.obj new file mode 100644 index 00000000..a85ae228 --- /dev/null +++ b/layouts/partials/latest-non-reply-note.obj @@ -0,0 +1,11 @@ +{{- $notePages := where .Site.RegularPages "Section" "eq" "notes" -}} +{{- $notePage := index $notePages 0 -}} +{{- if $notePage.Params.inReplyTo -}} + {{- range $notePages -}} + {{- if not .Params.inReplyTo -}} + {{- $notePage = . -}} + {{- break -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- return $notePage -}} diff --git a/layouts/partials/post-previews.html b/layouts/partials/post-previews.html index e66f929b..af3380db 100644 --- a/layouts/partials/post-previews.html +++ b/layouts/partials/post-previews.html @@ -68,17 +68,7 @@ {{- end -}} - {{- $notePages := where .Site.RegularPages "Section" "eq" "notes" -}} - {{- $notePage := index $notePages 0 -}} - {{- if $notePage.Params.inReplyTo -}} - {{- range $notePages -}} - {{- if not .Params.inReplyTo -}} - {{- $notePage = . -}} - {{- break -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- with $notePage -}} + {{- with (partial "latest-non-reply-note.obj") -}}
{{ partial "svg.html" (dict "name" "message") }} {{ partial "year-relative-date.html" .Date }} diff --git a/static/opensearch.xml b/static/opensearch.xml index a62e9118..a9a54d9d 100644 --- a/static/opensearch.xml +++ b/static/opensearch.xml @@ -5,4 +5,7 @@ /favicon.ico /favicon-32x32.png + false + en-gb + limited