How to add a footer to the RSS feed

I want to add a custom footer to the RSS feed of one of my blogs, so every new item or article shows a footer (short description, contact information) in an RSS reader.

I found a few articles for Wordpress but I can’t find a way to do it in the micro.blog nor in the Hugo documentation. I’m not too savvy.

Anybody knows how to do that? Thanks in advance.

You’d have to edit your theme and go into the RSS template and JSON feed templates to add your footer directly there.

Thank you, Jason. That’s exactly what I was looking at. I think I have to tweak the layouts/_default/rss.xml template. But I’m not able to find the exact code to make it work.

ChatGPT told me to add a paragraph to the <description> tag in the template:

<description>
        {{ .Content | html }}
        <p>For further info <a href="mailto:your-email@example.com">send me an email</a>.</p>
</description>

I was hopeful, but it didn’t work.

You can’t put HTML like that into RSS(XML). Either you need to use CDATA or escape the HTML.

Alternatively, you could put your footer paragraph in partial and then process it like content, passing it into HTML like the above… something like

{{ partial layouts/rss_footer.html | html }} I think might work, I haven’t tried.

Thanks a lot, @jsonbecker. It did not work. I tried both the CDATA and the partial methods (I don’t really know what I’m doing, but at least I found out that {{ partial "layouts/rss_footer.html" | html }} needs the "" marks around the template’s name, otherwise it gave a parsing error with the /character).
I’ll keep looking, thanks a lot.

I don’t see any indicator that this is making it to your RSS feed. What theme are you using? I’m beginning to suspect you’re editing the wrong template.

I’m using the Sumo Theme and editing the layouts/_default/rss.xml template