Hugo Full-Text RSS

1 minute read

When I checked the RSS feed for my site, I noticed it only outputs a summary of each post by default. While summaries can be useful, I prefer having the full post content available in the feed. This way, subscribers can enjoy the content directly in their feed reader without needing to visit the website.

As a heavy RSS user myself, addressing this was a priority. After a quick search, I found some Hugo documentation on RSS Templates that provided the solution.

Following the instructions, I created an override for the default RSS Template by copying the default content and placing it in my theme’s layouts/_default/rss.xml file. The original template outputs a summary of the post, as seen in this line:

1<description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>

By replacing .Summary with .Content, the full post content is included in the <description> field:

1<description>{{ .Content | transform.XMLEscape | safeHTML }}</description>

After making this change, I rebuilt the static assets for the site and confirmed that the entire post content was now being included in the feed. This adjustment ensures that my readers can fully engage with my posts directly from their preferred feed readers.