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 }}

View File

@@ -56,7 +56,9 @@
<copyright>{{ . }}</copyright>
{{ end }}
<description>{{ $description }}</description>
{{ with $description }}
<description>{{ . }}</description>
{{ end }}
{{ with $language }}
<language>{{ . }}</language>
@@ -66,13 +68,17 @@
<lastBuildDate>{{ . }}</lastBuildDate>
{{ end }}
<link>{{ $link }}</link>
{{ with $link }}
<link>{{ . }}</link>
{{ end }}
{{ with $editor }}
<managingEditor>{{ . }}</managingEditor>
{{ end }}
<title>{{ $title }}</title>
{{ with $title }}
<title>{{ . }}</title>
{{ end }}
{{ with $master }}
<webMaster>{{ . }}</webMaster>
@@ -126,7 +132,9 @@
<description><![CDATA[{{ . }}]]></description>
{{ end }}
<guid isPermaLink="false">{{ $guid }}</guid>
{{ with $guid }}
<guid isPermaLink="false">{{ . }}</guid>
{{ end }}
{{ with $link }}
<link>{{ . }}</link>