Libravatar filter for Jekyll

My blog is powered by Jekyll and I display gravatars on comments and for post author. As stated in my previous post, it's a centralized service. Now there is libravatar doing the same but not centralized. I wrote a gravatar liquid filter, now here is the libravatar liquid filter:

require 'libravatar'

module Jekyll
  module LibravatarFilter
    def to_libravatar(input)
      Libravatar.new(:email => input)
    end

    def to_secure_libravatar(input)
      Libravatar.new(:email => input, :https => true)
    end
  end
end

Liquid::Template.register_filter(Jekyll::LibravatarFilter)

It's based on libratar ruby gem that you have to install first:

$ gem install libravatar

See the libravatar filter on github.

Comments Add one by sending me an email.