How to make your content viewable in an RSS feed

The documentation I never found

April 24, 2021


I only recently was able to get my RSS feed at a state where my content is readable within an RSS reader, this is because I don't use any form of static site generator, instead I update everything manually and only recently learned how to do it. I figured I'd write a brief guide on how to do it for anyone who updates their manually like I do or for anyone interested in writing their own static site generator.

The bare minimum

The heading of your document

An RSS feed is simply an XML file so it is formatted as such. The first tag is should specify that it is an RSS feed along with the version of RSS used (version 2 is what I use I have no idea if this is the most recent version but it works for me), everything is contained within the RSS tag. Next is the channel tag, there's not much special about it other than it also wraps around everything in the document. You should use the title and link tags to specify the title of your feed and the link to your website.

Items

Each update on your RSS feed is contained within an item element. New items are what your RSS reader looks for when it refreshes. There are a few things which should be within each item.

Title

Obviously each item should have a title, this is again used with the title tag.

Link

More important than the title of your content is its link. The whole point of an RSS feed is to give links to new content so every item should have a full URL to the new content within a link element.

Making it better

As was implied by the heading, the last section only covered the bare minimum. If you do those things you will have a functioning RSS feed, but it will not really be complete. There are two more things that should be added to make your RSS feed actually useful.

pubdate

You should always specify when a new piece of content was published, this is done with the pubdate tag. If you want within this tag you can specify the date right down to the millisecond and it will work, but that is a bid overkill. I just type the date into there just like it is formatted at the top of this page.

The content

The description element is where you put your actual content, but you can't just put straight HTML in there, first you have to open it by typing <![CDATA[ and then adding your HTML and closing that off by typing ]]>. Do I know exactly what that thing means or really does? No not really, I just know that it lets your HTML show up correctly and that's really all I care about here

Images

You can also specify an image to be shown as a thumbnail to your content, I don't do this because, well . . . look around, I don't use images here very often, my RSS reader also doesn't support images so I don't miss them. But if you want them to be in yours I'll let you try to figure that out.

What I do

I will admit that this probably isn't the world's most helpful tutorial (buts it's better than anything I ever found). I suggest taking a look at my RSS feed to better understand this. Different browsers react differently when opening an XML file so I don't know exactly what you will be shown in every circumstance, but Brave will open it and format it in a very readable fashion. Get Brave then open my RSS feed with it and you'll see all the stuff I described here is easier than I probably made it sound.

You'll even notice that I have a template for a new item within a comment near the top of the document, I highly recommend giving yourself a similar template to make your life easier (I messed up my RSS feed several times before I started using one). Anyways now that I've taught you how to make a good RSS feed you and I both no longer have an excuse to have RSS posts which lack content.