Wrap all feed tags in conditions

This commit is contained in:
Will Faught
2025-02-14 16:21:46 -08:00
parent 49a73a63eb
commit eee0c972e2
2 changed files with 27 additions and 9 deletions

View File

@@ -60,7 +60,9 @@
<icon>{{ . }}</icon>
{{ end }}
<id>{{ $id }}</id>
{{ with $id }}
<id>{{ . }}</id>
{{ end }}
{{ range $page.OutputFormats }}
{{ $rel := cond (eq .Rel "canonical") "self" .Rel }}
@@ -86,9 +88,13 @@
<subtitle type="html"><![CDATA[{{ . }}]]></subtitle>
{{ end }}
<title type="html"><![CDATA[{{ $title }}]]></title>
{{ with $title }}
<title type="html"><![CDATA[{{ . }}]]></title>
{{ end }}
<updated>{{ $lastmod }}</updated>
{{ with $lastmod }}
<updated>{{ . }}</updated>
{{ end }}
{{ range $subpages }}
{{ $include := not (.Param "paige.exclude_feeds") }}
@@ -139,7 +145,9 @@
<content type="html"><![CDATA[{{ . }}]]></content>
{{ end }}
<id>{{ $id }}</id>
{{ with $id }}
<id>{{ . }}</id>
{{ end }}
{{ range .OutputFormats }}
{{ $rel := cond (eq .Rel "canonical") "self" .Rel }}
@@ -171,7 +179,9 @@
<title type="html"><![CDATA[{{ . }}]]></title>
{{ end }}
<updated>{{ $lastmod }}</updated>
{{ with $lastmod }}
<updated>{{ . }}</updated>
{{ end }}
</entry>
{{ end }}
{{ end }}