Mastodon

Creating Atom (RSS Like) feed for Jekyll blog

Aug 10, 2020 by Kolappan N

Jekyll is a great platform for developing your blog. It has many features that are geared towards the usage of blogs. It was a surprise to me when I found that the Jekyll blog does not have any RSS/Atom feed by default. But fortunately it is easy to add a feed to a Jekyll blog, thanks to Ruby gems.

We will use a Jekyll Feed plugin for this.

  1. Add the following line of code to your site’s Gemfile
gem 'jekyll-feed'
  1. And the below code to your site’s _config.yml
plugins:
 - jekyll-feed
  1. Run sudo bundle install to install the dependencies
  2. Now build your site. Go to the {your-site}\feed.xml to view the feed of your blog posts.

You will now see the ATOM feed, but with only 10 latest entries. Where are the rest? Jekyll Feed by default will limit the feed to latest 10 blog post. If you are someone who posts once or twice a month, this might be okay. If you are not suitable with the limit you can change it in the _config.yml. Here is the configuration,

## Feed
## Ref: https://github.com/jekyll/jekyll-feed
feed:
  posts_limit: 100

Before June 2020, this number was not configurable in Jekyll Feed (Ref). This is one of the reasons some blogs recommend using forks or other workaround. These are no longer needed.

This feed works perfectly well. Here is a screenshot of this blog’s feed from Feedly.

This blog’s feed as seen in Feedly
This blog's feed as seen in Feedly