=head1 NAME
Mojolicious::Plugin::Gravatar - Globally Recognized Avatars for Mojolicious
=head1 SYNOPSIS
# Mojolicious
$self->plugin('gravatar');
You can pass default size, rating, and default avatar url
$self->plugin('gravatar' => {
size => 60, #default was 80
rating => 'X', #default was PG
default => 'http://example.com/default.png' # default was not value
});
# Mojolicious::Lite
plugin 'gravatar';
# Gravatars in templates
<%= gravatar 'user@mail.com' %>
will generate
<%= gravatar_url 'user@mail.com' %> - if you need only url
Also you can overwrite any default config variables
<%= gravatar 'user@mail.com', size => 40, rating=> 'X' %>
If you need some styling for img tag:
<%= gravatar $email %>
and describe in css - ".gravatar img {border: 1px solid white;}"
=head1 DESCRIPTION
This plugin adds gravatar ( L ) helpers to your application.
=head1 CONFIG
=head2 default (optional)
The local (any valid absolute image URI) image to use if there is no Gravatar corresponding to the given email.
=head2 size (optional)
Gravatars are square. Size is 1 through 512 (pixels) and sets the width and the height.
=head2 rating (optional)
G|PG|R|X. The maximum rating of Gravatar you wish returned. If you have a family friendly forum, for example, you might set it to "G."
=head1 HELPERS
=head2 gravatar $email [, %options ];
generate img tag for getting avatar from gravatar.com
$email (required) The key to using Gravatars is a hex hash of the user's email. This is generated automatically and sent to gravatar.com as the gravatar_id.
%options (optional) - you can override config parameters . Support all parameters that you have in config
example
=head2 gravatar_url $email [, %options ];
generate url for getting avatar from gravatar.com
$email (required) The key to using Gravatars is a hex hash of the user's email. This is generated automatically and sent to gravatar.com as the gravatar_id.
%options (optional) - you can override config parameters . Support all parameters that you have in config
=head1 VERSION
Version 0.02
=head1 AUTHOR
Viktor Turskyi
=head1 CONTRIBUTORS
Nils Diewald (Akron)
=head1 BUGS
Please report any bugs or feature requests to C, or through
the web interface at L. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
Also you can report bugs to Github L
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Mojolicious::Plugin::Gravatar
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker
L
=item * AnnoCPAN: Annotated CPAN documentation
L
=item * CPAN Ratings
L
=item * Search CPAN
L
=back
=head1 ACKNOWLEDGEMENTS
=head1 LICENSE AND COPYRIGHT
Copyright 2011 "koorchik".
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
=cut