Both CSS-Tricks.com and FourKitchens.com use WordPress unĀ­der the hood.

They are a great exĀ­amĀ­ple of how the deĀ­ciĀ­sion to use an esĀ­tabĀ­lished frameĀ­work lends itĀ­self to good pracĀ­tices — withĀ­out the reĀ­quireĀ­ment of an exĀ­tenĀ­sive amount of efĀ­fort or knowlĀ­edge from its users.

Case in point, take the folĀ­lowĀ­ing two enĀ­tries from my Miniflux feed reader (which I self host):

An entry on Miniflux by Four Kitchens showing its title, author, time published, time required to read in minutes, and finally, actions a user can take such as: read, star, original, comments.

An entry on Miniflux by CSS Tricks showing its title, author, time published, time required to read in minutes, and finally, actions a user can take such as: read, star, original, comments.

You will noĀ­tice it has a ā€˜Commentsā€™ link. Let me make a bold claim: pretty much 9 out of 10 of my feeds donā€™t carry this, even when they ofĀ­fer comĀ­ments.

To figĀ­ure out how I could add this for my arĀ­tiĀ­cles too, I looked at Four Kitchenā€™s RSS feed and found a comments tag with a value that would link to the comĀ­ments secĀ­tion on the page.

Quite simĀ­ple, I thought.

Hereā€™s what I did next:

  1. Added an id of respond to my arĀ­tiĀ­cle layĀ­out where the comĀ­ments secĀ­tion starts.
  2. Updated my all-conĀ­tent and arĀ­tiĀ­cle feeds to add a comments tag where the post type is an arĀ­tiĀ­cle — with a value of that postā€™s permaĀ­link apĀ­pended with #respond (internal page link).
  3. Bonus: imĀ­pleĀ­mented naĀ­tive browser smooth scroll by adding scroll-behaviour: smooth; to the body style block in my stylesheet.

Then I tested it, andā€¦ no luck! šŸ˜¢

Moving from Atom to RSS 2.0

Turns out, the core Atom specĀ­iĀ­fiĀ­caĀ­tion doesĀ­nā€™t have anyĀ­thing that reĀ­semĀ­bles what is the comments tag in the RSS 2.0 spec.

The fool that I am, I beĀ­gan the process to move from Atom to RSS 2.0 beĀ­cause I reĀ­ally like silly stuff like that, and I also like to kill my time with stuĀ­pid stuff when I could be livĀ­ing the ā€œrealā€ life.

Because my feeds setup is not yet DRY, it took me over 2 hours to careĀ­fully piece everyĀ­thing toĀ­gether for all seven of my feeds.

In this process, I learned a lot about how to write an Atom feed vs how to write an RSS 2.0 feed. Despite the time spent, the efĀ­fort was well worth it and a very edĀ­uĀ­caĀ­tional jourĀ­ney.

Now the ā€˜Commentsā€™ link shows for my arĀ­tiĀ­cles and is an added inĀ­cenĀ­tive for a reader to drop by and say hello — quickly.

A screnshot from my Miniflux app which now shows an article from my feed carrying the Comments link

Hereā€™s some thoughts on this tranĀ­siĀ­tion, genĀ­erĀ­ally inĀ­cludĀ­ing data that wasĀ­nā€™t preĀ­sent beĀ­fore in the old Atom feeds (but not necĀ­esĀ­sarĀ­ily):

Description

I added a description tag to items so if I have set a meta deĀ­scripĀ­tion for any post (article or othĀ­erĀ­wise), RSS readĀ­ers can pick that up as an auĀ­thorĀ­iĀ­taĀ­tive preĀ­view of the post inĀ­stead of genĀ­erĀ­atĀ­ing a post sumĀ­mary from its conĀ­tent, then cutĀ­ting it short and makĀ­ing for a fussy exĀ­peĀ­riĀ­ence for the end-user.

Categories

Iā€™m not sure what adding a bunch of category tags does in an RSS feed. It doesĀ­nā€™t seem to make any visĀ­iĀ­ble difĀ­ferĀ­ence on Miniflux in my baĀ­sic testĀ­ing.

Do you know what purĀ­pose it serves? Please let me know in the comĀ­ments.

Last Build Date and Publish Date

RSS 2.0 also ofĀ­fers lastBuildDate and pubDate tags.

These are simĀ­iĀ­lar to Atomā€™s atom:updated tag.

lastBuildDate and atom:updated apĀ­pear to me to be slightly difĀ­ferĀ­ent in meanĀ­ing based on their laĀ­bels and deĀ­scripĀ­tions, but there are arĀ­guĀ­ments that theyā€™re the same. Or difĀ­ferĀ­ent. Or same. Who knows? See disĀ­cusĀ­sion on StackOverflow. I like the anĀ­swer by Chris Pratt.

At the chanĀ­nel level, his exĀ­plaĀ­naĀ­tion is what Iā€™m goĀ­ing with. pubDate may repĀ­reĀ­sent eiĀ­ther the date-time the last post was pubĀ­lished or modĀ­iĀ­fied. lastBuildDate refers to the date-time the feed was last creĀ­ated and made availĀ­able onĀ­line.

I still have conĀ­fuĀ­sion around whether the pubDate at the item level should upĀ­date if the arĀ­tiĀ­cle is upĀ­dated.

Still, at the item level, I have deĀ­cided I am goĀ­ing to use pubDate and set it to the post modĀ­iĀ­fied date if availĀ­able, falling back on the origĀ­iĀ­nal post pubĀ­lish date — simĀ­iĀ­lar to what Iā€™m doĀ­ing at the chanĀ­nel level with this tag.

Managing Editor and Web Master

RSS 2.0 also ofĀ­fers a couĀ­ple of inĀ­terĀ­estĀ­ing opĀ­tional propĀ­erĀ­ties on the channel elĀ­eĀ­ments: managingEditor and webMaster.

Miniflux apĀ­pears to use this info on the post page:

A screenshot from my Miniflux app showing the post entry page with the post title, action buttons such as: Read, Comments, Fetch Original Content, etc. It includes an additional data item now: the author's information.

You can obĀ­serve that my email and name are clearly disĀ­played for anyĀ­one to conĀ­tact me diĀ­rectly if they have any conĀ­cerns. This was not so in my Atom feed deĀ­spite specĀ­iĀ­fyĀ­ing the auĀ­thor inĀ­forĀ­maĀ­tion.

Date forĀ­mats

While my Atom feed was happy with ISO8601 dates, the W3C feed valĀ­idaĀ­tor was not happy with this when I moved to RSS.

Turns out RSS needs an RFC822 date.

I use the date-fns liĀ­brary and unĀ­forĀ­tuĀ­nately it does not ofĀ­fer a forĀ­mat funcĀ­tion for this spec. However, it did ofĀ­fer RFC7231 and RFC3339. A curĀ­sory look at both and it seemed to me RFC7231 might work. Which it did, and now all my feeds pass W3C valĀ­iĀ­daĀ­tion.


Thatā€™s all folks.

Iā€™m now an (almost) happy RSS 2.0 camper. šŸ˜Š

I was told Atom is the ā€œsuperiorā€ stanĀ­dard — which it may well be — but I find RSS 2.0 more suitĀ­able for my goals. So, here we are.