A Metalsmith plugin for Gravatar.
This plugin converts email addresses into their associated Gravatar URLs and adds them to Metalsmith's metadata object.
npm install --save metalsmith-gravatar
If you haven't checked out Metalsmith before, head over to their website and check out the documentation.
If you are using the command-line version of Metalsmith, you can install via npm, and then add the
metalsmith-gravatar key to your
var gravatar = require'metalsmith-gravatar';metalsmithusegravatarstevenschobert: "email@example.com";
This plugin will a new metadata property named
gravatar. This object will contain all the
Gravatar URLs you can use in your templates:
Nested objects map directly into the output'ed
gravatar object, so you can access them by the same
If you want more control over how the Gravatar URLs are generated, you can specify an
object. If the plugin sees this
options object, it will expect the avatars you wish to convert to
be in a new
Below is a list of options that are supported:
'http' (default)) or
Sets the URL prefix for Gravatar images. Useful if you are serving a page via SSL and want to also load the external images via SSL.