Gravatar add on for statamic
( http://gravatar.com | http://statamic.com )
The Gravatamatic plugin is used to simplify the use of gravatars in your templates.
- Download the zip file (or clone via git) and unzip it or clone the repo into
/_add-ons/
. - Ensure the folder name is
Gravatamatic
(Github timestamps the download folder). - Enjoy.
Example Tag:
{{ gravatamatic:avatar email="[email protected]" size="200" rating="g" default="monsterid"}}
<div class="avatar"><img src="{{ avatar_url }}" width="{{ width }}" height="{{ height }}"></div>
{{ /gravatamatic:avatar }}
Email address of the gravatar you wish to request.
email="[email protected]"
The width of the gravatar you need. All gravatars are square, so this is also the height. Any integer in range 1-2048. Defaults to 80.
size="200"
Gravatar have a handy rating systems. You'll likely want the default 'suitable for all'. For other options check the list at https://en.gravatar.com/site/implement/images/
rating="r"
The default option steps in when there isn't a Gravatar available for an email address. You can pass in a full URL or you can pass in a code indicating the type of generated avatar you'd like to see. For the up to date list of options check the list at https://en.gravatar.com/site/implement/images/
default="identicon"
default="http://yoursite.com/yourimage.jpg"
The following single variables are available inside the {{ gravatamatic:avatar }}
tag pair.
{{ email }}
{{ avatar_url }}
{{ width }}
{{ height }}
Example Tag:
{{ gravatamatic:quicky email="{{ contact_email }}" }}
Email address of the gravatar you wish to request.
email="[email protected]"
The width of the gravatar you need. All gravatars are square, so this is also the height. Any integer in range 1-2048. Defaults to 80.
size="200"
Gravatar have a handy rating systems. You'll likely want the default 'suitable for all'. For other options check the list at https://en.gravatar.com/site/implement/images/
rating="r"
The default option steps in when there isn't a Gravatar available for an email address. You can pass in a full URL or you can pass in a code indicating the type of generated avatar you'd like to see. For the up to date list of options check the list at https://en.gravatar.com/site/implement/images/
default="identicon"
default="http://yoursite.com/yourimage.jpg"
This single tag simply returns an img tag.