RSS Feed Tutorial

This is a tutorial about how to set up and update your (static) website's RSS feed.

Table of Contents

  1. What is an RSS Feed?
  2. The RSS File
  3. Updating the Feed
  4. Resources and Closing Remarks

What is an RSS Feed?

Before the days of smartphones, social media, and their convenient(?) notifications, RSS feeds were used to give users a newsfeed of their favorite websites. Unlike modern social media, RSS feeds give you the updates that you ask for, no more and no less. Though some website builders like Wordpress have automatic RSS feeds, static websites like ones on Neocities require webmasters to manually add and maintain RSS code on their website.

To view a website's RSS feed, you need an RSS reader. I personally use Feeder (for Android phones). I have not looked into ones for desktop or iPhones, so please do your own research on those.

The RSS File

An RSS file typically is a file called "feed.xml" located in your website's root (top-level) folder. The RSS file is an XML file that contains information about the website (also referred to as a "channel") as well as its updates (also referred to as "items"). I recommend that your feed file should look something like this (elements in brackets would be changed to fit your website):

(I'll go into more detail about the <guid> element in the next section. You may reuse what is in the <link> for testing purposes.)

The <pubDate> element must follow the RFC 822 Date and Time Specification. (e.g. Mon, 05 Dec 2022 22:19:53 GMT) I use epochconverter.com to get the current date and time for my <pubDate> elements.

You will also need to add the following code within the <head> block(s) of any pages you wish to include in your feed:

Before moving on, please check the validity of your RSS file so far by entering its URL into an RSS Validator like this one.

Updating the Feed

To update your feed, you will need to create another item within the <channel> block. The easiest way to do this would be to copy and paste your previous item n the file. The <title>, <description>, and <pubDate> elements will need to be changed, of course; and the <guid> will need to be changed as well. It serves as a unique identifier for the update/item. If it is not a unique URL, the RSS will not recognize it as a new update. I format my <guid> element as follows:
https://pklucky.neocities.org/xml/item1670376976

The number after "item" is the Unix epoch time of the <pubDate> (which can also be obtained from epochconverter.com). Using this method guarantees a unique <guid> element, but you may format it any way you want as long as you're consistent about it.

As you update your feed more and more, you may find that your feed file is getting too long. Feel free to delete older items as you see fit!

Resources and Closing Remarks

If you would like to see what else you can add to an RSS file, I'd recommend visiting the RSS Advisory Board for more information. This website also provides sample RSS files that you can compare your file to as well as best practices for formatting it.

I have also provided a small sample of my own RSS that you can compare to as well:

I would like to thank both the RSS Advisory Board for their resources on RSS as well as sadgrl's tutorial How to connect your static site to RSS for providing a starting point on how to set up an RSS feed in the first place. While not bad resources, they were either providing too much information at once or too little information to work off of to properly set up an RSS feed. I hope this tutorial is a good starter guide for those of you who want to add a feed to your own static website!

If you have any questions, feel free to comment on my Neocities profile or email me at pklucky@proton.me