Created
November 22, 2012 11:46
-
-
Save tracend/4130741 to your computer and use it in GitHub Desktop.
Handlebars.js - Gravatar thumbnail #handlebars #cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handlebars.js - Gravatar thumbnail | |
// Usage: {{#gravatar email size="64"}}{{/gravatar}} [depends on md5.js] | |
// Author: Makis Tracend (@tracend) | |
Handlebars.registerHelper('gravatar', function(context, options) { | |
var email = context; | |
var size=( typeof(options.hash.size) === "undefined") ? 32 : options.hash.size; | |
return "http://www.gravatar.com/avatar/" + MD5( email ) + "?s="+ size; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment