Instagram Liquid Tag Plugin for Jekyll and Octopress27 Nov 2011
Being new to the world of Ruby (and obviously Jekyll), I thought a good initial learning experience would be to write a liquid tag for Jekyll to display an Instagram photo. I finished up a decent enough version of the code, and it's actually in use over at lukelov.es to display all my Instagrams. Check out this page for a complete example of what the finished product looks like.
It is a simple liquid tag which takes one parameter, the ID of a media item from Instagram. The code then fetches the media item using Instagram's ruby gem, and writes a bunch of relevant HTML to the page.
I currently have it displaying:
- the 612x612 version of the image (which links to the photo on Instagram)
- the filter used to create the image
- a static map of where the image was taken using the Google Static Map API
- the name of the location where the image was taken
- a link to comment on the Instagram using webstagram
Obviously, the location information is only displayed if the Instagram has that data associated with it.
If you have questions, comments, bugs, etc, please leave a comment on this post or the gist, and if you'd like to contribute fixes or features directly, you can submit a pull request for this file.
On a side note, I also came up with a solution for how to batch create Instagram posts (as you might've noticed by the hundreds of Instagram posts on lukelov.es). The solution was to create a few Rake tasks similar to the ones that are already being used by Octopress to create new posts and pages. I will be writing another blog post soon detailing those and how they work, but if you would like a sneak peak, checkout the Rakefile for lukelov.es.