runtimeterror/content/posts/prettify-hugo-rss-feed-xslt/index.md
2024-04-29 20:31:02 -05:00

1.6 KiB

title date draft description featured toc comments categories tags
Prettify Hugo Rss Feed Xslt 2024-04-29 true This is a new post about... false true true Backstage
hugo
meta

I put in some work several months back making my sure my site's RSS would work well in a feed reader. This meant making a lot of modifications to the default Hugo RSS template. I made it load the full article text rather than just the summary, present correctly-formatted code blocks with no loss of important whitespace, include inline images, and even pass online validation checks:

Validate my RSS feed

But while the feed looks great when rendered by a reader, the browser presentation left some to be desired...

Ugly RSS rendered without styling

It feels like there should be a friendlier way to present a feed "landing page" to help users new to RSS figure out what they need to do in order to follow a blog - and there absolutely is. In much the same way that you can prettify plain HTML with the inclusion of a CSS stylesheet, you can also style boring XML using eXtensible Stylesheet Language Transformations (XSLT).

This post will quickly cover how I used XSLT to style my blog's RSS feed and made it look like this:

Much more attractive RSS feed with styling to fit the site's theme

Starting Point

I won't go into too much detail