Adding reply link in feeds

In my last post I mentioned how the current theme doesn't allow any means to configure the feeds. Well, that was not entirely correct. Digging in the Publii Github repo lead me to the handlebar templates used to generate the Atom and JSON feed. It was then a matter of copying the feed-xml.hbs file to my theme override folder and editing the feed template to add the Reply via email link at the bottom of the feed. Atom feed is made up of xml and the only way to add an html element in xml is via CDATA.

feed template with a reply link after the post content
feed template edited to show reply link after the post

This generates a link "Reply via email" below every post in the feed automatically and thanks to the handlebar tag {{title}}, adds the post title in the subject line. Very handy. 

Reply via email link at the bottom of a post in feed
Reply via email link at the bottom of a post in feed

I am removing JSON feed for now as I couldn't figure out how to make a custom link to show up along with the html content (as with the Atom feed) and didn't want the two feeds to look different. JSON feed doesn't seem to support email address field that can be read by feed readers either (like RSS does currently with <managingEditor>). If anybody was subscribed to the JSON feed, I hope their feed reader informs them about the timeout on the feed and they subscribe to Atom feed instead. Apologies for this inconvenience.

Related posts

Adding comments to the blog

Its not that people are dying to share their feedback for this blog but I found a small, open-source, privacy-first comment system that isn't shabby and works great. I can…

Adding DuckDuckGo search

As my post count increase (since many posts are tagged under the 100DaysToOffload challenge), the archive is getting harder to sift through to find posts of interest. The tags might…