Adding an RSS feed
... while keeping things simple.
Simplicity!
Once upon a time, this site was generated statically. Then... I decided that this was way too complex; let's write HTML by hand instead!
Which... has worked surprisingly well. Good luck persuading e.g. Hugo to produce e.g. a neatly colored, weird conversation between various servers. (You might be able to; it'd definitely take longer.) And then... I could also get away without even generating an index page, by some weird iframe hackery.
As for RSS feeds... in the name of "delete the part or process", there... wasn't one. It's one more thing to update, either by hand (more work!), or automatically (um OK I'd actually need to write something that does anything automatically).
But hey, no one is missing one, right?
... but then someone actually asked me about it.
And then there was another person. Okay, maybe. Possibly. I might add one.
(I'll also go on & call this "by popular request". It's more than one person, so that counts, right???)
The Shirk & Turk Principle
I probably shouldn't repeat everything in this great article, of the same title, by dreeves (of Beeminder fame)... I'm actually going to lift their tl;dr, too:
"When writing a new app or website or feature, implement as little of it as you can get away with and manually fake the rest behind the scenes."
-- Daniel Reeves, Beeminder
As you might guessed: yes, this actually resulted in me just sitting down and typing the following into a text editor:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Simon Safar</title>
<link>https://simonsafar.com/</link>
<description>All recent entries from simonsafar.com</description>
<language>en-us</language>
<lastBuildDate>22 Oct 2021 00:00:00 -0700</lastBuildDate>
<atom:link href="http://simonsafar.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Adding an RSS feed</title>
<link>https://simonsafar.com/2021/adding_an_rss_feed/</link>
<guid>https://simonsafar.com/2021/adding_an_rss_feed/</guid>
<pubDate>22 Oct 2021 00:00:00 -0700</pubDate>
<description>
Adding an RSS feed... with obnoxiously minimal added complexity.
</description>
</item>
<item>
<title>Novation Circuit Backup</title>
<link>https://simonsafar.com/2021/circuit_backup/</link>
<guid>https://simonsafar.com/2021/circuit_backup/</guid>
<pubDate>16 Oct 2021 00:00:00 -0700</pubDate>
<description>
Backing up a MIDI instrument even if their web thing is broken... by looking at USB traffic!
</description>
</item>
<item>
<title>QEMU is awesome</title>
<link>https://simonsafar.com/2021/compiling_qemu/</link>
<guid>https://simonsafar.com/2021/compiling_qemu/</guid>
<pubDate>15 Oct 2021 00:00:00 -0700</pubDate>
<description>
QEMU is awesome.
</description>
</item>
</channel>
</rss>
That's it. It's just a list of the latest few articles.
(... well, actually, I just looked at a few RSS feeds from a few sites and took whatever I liked.)
Note that it does not add the following features:
- a list of all posts. It's just the top few; the actual point is notifications of new posts, anyway. You can read the rest by using the sidebar!
- day-of-week next to all the dates. Whoever came up with the idea of including them in a standard for computers to talk with each other... fortunately, as per RSS 822, it's optional.
- actual post contents. Is it just me thinking that pasting all the contents of the blog into a single xml file that is supposedly just for notifications... weird? Many of you might disagree. But, most importantly, it's making stuff more complicated, so: maybe to be done later if everyone misses this! Edit: people actually miss this. So... it might end up being implemented once all this will be Actually Automated... which it is... currently... isn't.
- an actual link to the post in the description. Well, this is what the link field is for.
- update times / dates are inaccurate. As in: everything happens at midnight. Hopefully not a lot of people care about this either.
Meanwhile though... I got this from the W3C validator!
Calling this good for now.
... and you're calling this simple???
Well, in terms of implementation effort, it's perhaps not the simplest thing. However... it comes with one big benefit: I know exactly what's going on.
Of course, clicking an "add RSS feed" button on something is a lot simpler... and it's probably the right choice for many people, too. But if you're actually thinking of implementing this at some point... what better way is there to figure out how to generate an RSS feed than to actually write one? (Code being soldified thought fragments and all that.)
... comments welcome, either in email or on the (eventual) Mastodon post on Fosstodon.