I was looking for a way to make my audiobooks easily available to my wife, and I found an awesome solution using Jekyll and Jekyll Collections.
Adding a collection to Jekyll will allow you to generate additional feeds, not just the built-in posts feed that Jekyll has right out of the box. With some small additions to your
_config.yml, you will be on your way.
Let’s Do It
The first thing to do is to add a collection to your
Here is the snippet that needs to be added to your config file to create a new collection:
This initializes the audio collection. For more documentation on Jekyll Collections, check out the documentation on Jekyll’s site.
Now create a folder named
_audio in your Jekyll root, just like the
_posts folder. You can then create a markdown document in the
_audio folder and Jekyll will pick it up and process it just like it does with markdown files in the
_posts folder. You’ll need to set the layout, title, and other variables that you want to use.
My audiobook markdown file consists of the following:
Make an iTunes RSS Podcast Feed
Now we need to build a template file we can use for a podcast feed and place it in a folder called
audio in the Jekyll root folder. You can call the file
feed.xml or whatever you want, it really isn’t important as long as you remember what it is.
This is my
At this point, besides your default Jekyll directory structure, you should have something like this:
I’m hosting my audiobook files from my Dropbox. With a free Dropbox account, you get 10GB of bandwidth per day, whereas a paid account gets 250GB per day. You aren’t likely to hit either limit if you are privately listening to your books using this method.
If you do host your files on Dropbox, set the
file: "http://linktofile.com/file.mp3" in your audiobook markdown file to its Dropbox link. You can get the link by right-clicking the file on your computer located in your Dropbox folder, and picking Share Dropbox Link. Paste the link into your markdown file and change the
dl=0 at the end of the link to
dl=1 and you are set.
Accessing Your Feed
Once you’ve deployed your Jekyll site and you’ve got your audiobook file synced to Dropbox, you just need to point your favorite podcasting app at your feed URL. In our example case, it would be something like