From db22cddc10c548452c8cdc51cc12d6cd88afd322 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Fri, 15 Sep 2023 08:42:45 +0100 Subject: [PATCH] Fix main RSS feed --- layouts/_default/rss.xml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 03fab67c..4dbfedab 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,14 +1,14 @@ -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = index .Site.Sections 0 }}{{- end -}} {{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} +{{- if .IsHome -}} + {{- $pages = where .Site.RegularPages "Type" "not in" (slice "memex" "timeless" "site-infra") -}} +{{- else if $.IsSection -}} + {{- $pages = .RegularPages -}} {{- else -}} -{{- $pages = $pctx.Pages -}} + {{- $pages = .Pages -}} {{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} + {{- $pages = $pages | first $limit -}} {{- end -}} {{- printf "" | safeHTML }} {{- printf "" | safeHTML }} @@ -26,16 +26,26 @@ {{- with .OutputFormats.Get "RSS" -}} {{ printf "" (.Permalink | absURL) .MediaType | safeHTML }} {{- end -}} - {{ range $pages }} + {{ range $pages }}{{ $page := . }} - {{ .Title }} + {{ .Title | default (delimit (slice "An untitled" (.Date.Format "January") (.Type | singularize)) " ") }} {{ .Permalink | absURL }} {{ if .Page.Params.Audio }}{{end}} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink | absURL }} - {{ .Summary }} - {{ .Content | html}} + + {{- with index .Params.Media 0 }} + + {{ end -}} + {{- .Summary -}} + + + {{- range $i, $src := .Params.Media }} + + {{ end -}} + {{- .Content | html -}} + {{ end }}