Alex Henning home about projects blog

Setting up an atom feed

Setting up an RSS feed

Once you've set up a blog, you might want to set up an RSS feed. And if you don't, well then, too bad! Setting up an RSS feed is quite simple with jekyll. First create a file called atom.xml.

> touch atom.xml

Next, just copy my atom.xml into your atom.xml, changing username, email and the site to fit your site. It's a pretty plain file, mostly just saying that it's an atom feed

1:  { % for post in site.posts limit:25 % }
2:  <entry>
3:    <title>{ { post.title } }</title>
4:    <link href="{ { post.url } }"/>
5:    <updated>{ { | date_to_xmlschema } }</updated>
6:    <id>{ { }}</id>
7:    <content type="html">{ { post.content | xml_escape } }</content>
8:  </entry>
9:  { % endfor % }

However, this segment is pretty interesting, jekyll runs a loop that creates an atom <entry> for the last 25 posts posted. You can remove limit:25 to show all posts ever, but that would become obnoxious after you got a large number of posts. Just pick a number that seems reasonable and go with it.

Posted on 19 October 2010 in blogging atom jekyll rss

<Previous: Technology behind this blogNext: Disqus Comments>

blog comments powered by Disqus