Thanks.
I assumed as much, but was hoping there was a better way to do this as I’ve already done the logic for each RSS feed.
If it helps anyone, here’s part of my code:
{{define "main"}}
{{range where .Sections "Section" "in" (slice "products" "notes" "newspapers")}}
{{range where .Pages "Layout" "==" ""}}
<item>
<title>{{(cond (eq .Params.publisher nil) .Title (print .Params.publisher " - " .Title)) | htmlEscape}}</title>
<description>
{{if eq .Section "products"}}
{{htmlEscape .Summary | plainify}}
{{else if eq .Section "notes"}}
{{htmlEscape .Description | plainify}}
{{else}}
{{$description := .Summary | default (partial "newspapers/printers.html" .)}}
{{htmlEscape $description | plainify}}
{{end}}
</description>
</item>
{{end}}
{{end}}
{{end}}
This validates using the W3C Feed Validation Service. I tried just using html
as per the doc examples but kept getting formatting errors from the validator so ended up with htmlEscape
and plainify
.
If there’s a better way to achieve the same result, let me know. I’m open to feedback!