From eee0c972e2dda273072000eca930e01d93cdfb15 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Fri, 14 Feb 2025 16:21:46 -0800 Subject: [PATCH] Wrap all feed tags in conditions --- layouts/_default/list.atom.xml | 20 +++++++++++++++----- layouts/_default/list.rss.xml | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 67e7cbbe..c826f7da 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -60,7 +60,9 @@ {{ . }} {{ end }} - {{ $id }} + {{ with $id }} + {{ . }} + {{ end }} {{ range $page.OutputFormats }} {{ $rel := cond (eq .Rel "canonical") "self" .Rel }} @@ -86,9 +88,13 @@ {{ end }} - <![CDATA[{{ $title }}]]> + {{ with $title }} + <![CDATA[{{ . }}]]> + {{ end }} - {{ $lastmod }} + {{ with $lastmod }} + {{ . }} + {{ end }} {{ range $subpages }} {{ $include := not (.Param "paige.exclude_feeds") }} @@ -139,7 +145,9 @@ {{ end }} - {{ $id }} + {{ with $id }} + {{ . }} + {{ end }} {{ range .OutputFormats }} {{ $rel := cond (eq .Rel "canonical") "self" .Rel }} @@ -171,7 +179,9 @@ <![CDATA[{{ . }}]]> {{ end }} - {{ $lastmod }} + {{ with $lastmod }} + {{ . }} + {{ end }} {{ end }} {{ end }} diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml index 54b14a2f..ea6da0fe 100644 --- a/layouts/_default/list.rss.xml +++ b/layouts/_default/list.rss.xml @@ -56,7 +56,9 @@ {{ . }} {{ end }} - {{ $description }} + {{ with $description }} + {{ . }} + {{ end }} {{ with $language }} {{ . }} @@ -66,13 +68,17 @@ {{ . }} {{ end }} - {{ $link }} + {{ with $link }} + {{ . }} + {{ end }} {{ with $editor }} {{ . }} {{ end }} - {{ $title }} + {{ with $title }} + {{ . }} + {{ end }} {{ with $master }} {{ . }} @@ -126,7 +132,9 @@ {{ end }} - {{ $guid }} + {{ with $guid }} + {{ . }} + {{ end }} {{ with $link }} {{ . }}