I think I’m going to turn this into a series of posts, about a lot of popular Jekyll plugins - and how you just aren’t gonna need them. We’ll see how far we get. And where better to start than jekyll-feed? The popular feed plug-in that publishes an Atom feed that includes your 10 most recent posts, no more, no less, and no optionto configure that number.
This bugs me. I’ve seen Feedly do annoying things with a small number of feeds in the past. I have some feeds I like to read periodically, but not regularly. Very rarely some of these same feeds would start disappearing their old items far too quickly (like within a few weeks, not a month). But I digress, and maybe this didn’t have anything to do with their feeds.
In any case 10 seems like a completely arbitrary number to me and also a bit small for my personal tastes. Thankfully, you don’t need jekyll-feed or it’s limitations. I glanced at Daring Fireball’s atom.xml feed for a little inspiration and just built my own from there. Here’s what it looks like:
atom.xml
The post.link_to conditional is just how I do my link/commentary style posts - allowing the default link to point the content itself rather than to my blog post. If your use case is simpler just remover that if/else; and that’s half the point of just using a template rather than a plug-in - so easy to bend to your own use.
Why alternate between CDATA and xml_escape? No reason. I may just as likely go back and change them all to CDATA later. It that’s your style, go for it. My goal here isn’t to say “use my great templates” or to publish another feed plug-in - it’s to point out how easy this all is to do it yourself - the way you want.