Easy Way to Add RSS Feeds to Your Jekyll Site: No Plugins Required
This very website uses Jekyll and on this post you will see how easy is to add RSS Feeds (XML and JSON) to your Jekyll site without adding any third party plugins.
One of greatest Jekyll features is that any file can be a page or an endpoint route by adding the double of three dashes as the first lines of the file.
In our example, our both files will follow the pattern:
--- layout: null permalink: /the-route-you-want.ext ---
layout: null, we inform Jekyll that the file will behave as it is, but it will still have the power behind.
Let’s assume that your posts have the required information like
external_url, etc., to work as seen in both feeds bellow. The feed will run through your posts and format the file accordingly.
Having them under your control allows you to customize them the way you want with the information you’re willing to expose.
The XML Feed needs to follow the Atom Convention.
The JSON Feed will conform to JSON Feed Convention.
You can also do a similar thing for the sitemap of your website.
You can check the results right here.