Find it here or in the header on the top right-hand corner.
Imagine a world where you can see the content of each website you like inside the app of your choosing, read the articles offline and save them on disk for later, be notified whenever the website has something new, and all of which is implemented with an open standard. Well that was most of the web some years ago and this blog now does all of that.
And it's not hard! The only thing we need is to serve a feed.xml
file that lists articles with some metadata such as 'updated at' and a UUID to be able to uniquely identify an article. This XML file is an Atom feed which has a nice RFC.
I implemented that in under an hour, skimming at the RFC and examples. It's a bit hacky but it works. The script to do so is here. And you can do too! Again, it's not hard. Here goes:
- We pick a UUID for our feed. I just generated one and stuck it as a constant in the script.
- The 'updated at' field for the feed is just
time.Now()
. It's not exactly accurate, it should probably be the most recentmtime
across articles but it's good enough. - For each article (
*.html
) file in the directory, we add an entry (<entry>
) in the XML document with:- The link to the article, that's just the filename in my case.
- The 'updated at' field, which is
just thequeried from gitmtime
of the file locally - The 'published at' field, which is
just thequeried from gitctime
of the file locally - A UUID. Here I went with UUIDv5 which is simply the sha1 of the file name in the UUID format. It's nifty because it means that the script is stateless and idempotent. If the article is later updated, the UUID remains the same (but the
updated at
will still hint at the update).
And...that's it really. Enjoy reading these articles in your favorite app!