This is a simple guide to adding an RSS Feed to your Neocities site, by hand.
RSS is a simple format, similar to HTML. To can create an RSS Feed for your site in any text editor, including the one provided by Neocities in the browser. Just like with HTML you need a bit of boilerplate to get started. It looks like this:
<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>Your RSS Feed Title</title> <description>This is the description of your RSS feed</description> <link>https://rssguide.neocities.org</link> <lastBuildDate> Tue, 10 Jul 2018 09:58 +0100 </lastBuildDate> <ttl>20000</ttl> </channel> </rss>
That's an empty RSS Feed. The lastBuildDate
tag together with the ttl
tag provide hints for RSS readers how often they should update the feed. It is important to adhere to the format of the timestamp. It must be compliant to RFC 2822. Since understanding RFCs is a bit complicated, I recommend you use a handy timestamp generator, for example here.
After saving the above text in a file on your server, e.g. feed.txt
you can add a link somewhere on your site to let people know where to find your feed. Additionally you can add a tag to the header of your website let browsers know that your site has an RSS feed so that they can activate RSS support if they have it. Add the following next to the meta
tags in the header: <link href="https://rssguide.neocities.org/feed.txt" rel="alternate" type="application/rss+xml" title="What's new on rssguide.neociites.org" />
.
Adding items to your feed is easy too. An item looks something like this:
<item> <title>The title of your item</title> <description> An arbitrary description of your item, for example the content of your new article, or a short excerpt. </description> <link>https://rssguide.neocities.org/the_article.html</link> <pubDate> Tue, 10 Jul 2018 09:58 +0100 </pubDate> </item>
The pubDate
tag again must contain the date in the RFC 2822 format. Don't forget to adapt the lastBuildDate
as well.
If you want to add HTML in the description that's possible as well, but you first have to run it through a tool that escapes special characters like <. Here is such a tool.
You can add files to your item with the enclosure
tag. Check Wikipedia for an example.
Now you just add the item
after the ttl
and you're done. The finished feed looks like this:
<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>Your RSS Feed Title</title> <description>This is the description of your RSS feed</description> <link>https://rssguide.neocities.org</link> <lastBuildDate> Tue, 10 Jul 2018 09:58 +0100 </lastBuildDate> <ttl>20000</ttl> <item> <title>The title of your item</title> <description> An arbitrary description of your item, for example the content of your new article, or a short excerpt. </description> <link>https://rssguide.neocities.org/the_article.html</link> <pubDate> Tue, 10 Jul 2018 09:58 +0100 </pubDate> </item> </channel> </rss>
Eventually you might want to purge old items from the bottom of your feed, but that's not strictly necessary.