From 6198c735aaf5a3bec54a23dfc4a3b4bff076a061 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Fri, 31 Jan 2025 17:40:08 +0000 Subject: [PATCH] RSS feed items with no title Removes the title for items that have none & fixes the XSL to make more sense for those items. --- layouts/_default/rss.xml | 6 ++-- static/rss.xsl | 62 ++++++++++++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 0779d099..169b2e82 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -25,10 +25,10 @@ {{ printf "" (.Permalink | absURL) .MediaType | safeHTML }} {{- end -}} {{ printf "" ("/opensearch.xml" | absURL) | safeHTML }} - {{- range $i, $page := (first 42 $pages) -}} + {{- range $i, $page := $pages -}} {{- if $page.Params.inReplyTo -}}{{ continue }}{{- end -}} - - {{ .Title | default (delimit (slice "An untitled" (.Date.Format "January") (.Type | singularize)) " ") }} + {{ with .Title }} + {{ . }}{{ else }}{{ end }} {{ .Permalink | absURL }} {{ if .Page.Params.Audio }}{{end}} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} diff --git a/static/rss.xsl b/static/rss.xsl index 59894dc1..20695149 100644 --- a/static/rss.xsl +++ b/static/rss.xsl @@ -34,6 +34,9 @@ .item { max-width: 768px; } + p { + position: relative; + } a { color: #4166f5; text-decoration: none; @@ -44,6 +47,19 @@ a:hover { text-decoration: underline; } + a:has(time) { + display: block; + text-align: right; + } + article:not(:first-of-type):not(:has(hgroup)) p::before { + content: ''; + display: block; + position: absolute; + top: -1.4em; + left: calc(50% - 1.5em); + width: 3em; + border-top: 1px solid rgba(128,128,128,0.5); + } @@ -68,23 +84,39 @@

Recent Posts