Simple Rss Feed With Jekyll

under Programming Jekyll


With moving my site off of Wordpress, I landed on Jekyll, but wanted to add an RSS feed option. Here is a simple way, without plugins. One of its example Generator plugins for Jekyll is their jekyll-feed plugin, used as a reference for those creating similar style file generation. Since I am Gemfile less currently, I really didnt want to add another configuration item, and it dawned on me…just build the RSS feed using templates and liquid!

Below is an example of just that, a template for atom 2.0 formatted post list.


permalink: /feed.xml
<feed xmlns="">
	<title>{{ site.title }}</title>
	<subtitle>{{ site.tagline }}</subtitle>
	<link href="{{ site.url}}/feed/" rel="self" />
	<link href="{{ site.url}}" />
	<id>{{ site.url}}</id>
	<updated>{{ site.time | date: '%FT%TZ' }}</updated>
    {% for post in site.posts %}
        <title>{{ post.title | xml_escape}}</title>
        <updated>{{ | date: '%FT%TZ' }}</updated>
        <id>{{ site.url}}{{ post.url }}</id>
        <link>{{ site.url}}{{ post.url }}</link>
        <summary>{{ post.excerpt |  strip_html | xml_escape }}</summary>
    {% endfor %}