This jekyll plugin generates Atom feeds for your site. One feed will be generated that includes all posts from your site, while the rest of the feeds will be broken down by category.
Place the category_feeds.rb
file into the _plugins
directory of your Jekyll
site. If the directory does not exist, create it.
This plugin requires Atom-Tools to be installed. To install this, just run the following:
gem install atom-tools
For feeds to be generated correctly, you'll need some options set in your site's
_config.yml
file.
When you run Jekyll feeds will be placed into your set feed_dir
or the
directory feed
if you haven't specified it in your configuration.
As example, lets say you have two categories, Art for posts related to artwork and Technology for techy blog posts. Your feeds will be placed in your site's output folder and should look something similar to this:
|- _site/
| |- feed/
| | |- Art/
| | | |- atom.xml
| | |- Technology/
| | | |- atom.xml
| |- atom.xml
The feed/atom.xml
file will contain posts from all categories.
In your site you may want to link to the feed associated with the category of
your page. A liquid tag is provided to do just this; just include {% page_feed_url %}
in your page. The url to the feed will match the category
associated with your page.
If you want to allow automatic discovery of your feeds, you can include this in your header.
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="{% page_feed_url %}" />
If your page has a category in it's url, such as Art
, it will point to the
feed for that category. If we can't match a category in the url, the feed
containing all posts is given.
Feel free to fork this project, send me pull requests, and issues through the project's github page.