Giter Site home page Giter Site logo

mojolicious-plugin-gravatar's Introduction

NAME

Mojolicious::Plugin::Gravatar - Globally Recognized Avatars for Mojolicious

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
    scheme  => 'https' # if omitted will look in request's url scheme.
});

# Mojolicious::Lite
plugin 'gravatar';

# Gravatars in templates
<%= gravatar '[email protected]' %>
will generate
<img src="http://www.gravatar.com/avatar/6ad193f57f79ac444c3621370da955e9&amp;s=80&amp;r=PG" alt="Gravatar" height="80" width="80">

<%= gravatar_url '[email protected]' %>  - if you need only url 

Also you can overwrite any default config variables 
<%= gravatar '[email protected]', size => 40, rating=> 'X' %>


If you need some styling for img tag:
<span class='gravatar'>  <%= gravatar $email %> </span>
and describe in css - ".gravatar img {border: 1px solid white;}"
    

DESCRIPTION

This plugin adds gravatar ( http://gravatar.com ) helpers to your application.

CONFIG

default (optional)

The local (any valid absolute image URI) image to use if there is no Gravatar corresponding to the given email.

size (optional)

Gravatars are square. Size is 1 through 512 (pixels) and sets the width and the height.

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."

scheme (optional)

Gravatar URL scheme "http" or "https". If omitted will look in request's url scheme (if empty fill use "http").

HELPERS

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 <img src="http://www.gravatar.com/avatar/6ad193f57f79ac444c3621370da955e9&amp;s=80&amp;r=PG" alt="Gravatar" height="80" width="80">

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

VERSION

Version 0.02

AUTHOR

Viktor Turskyi <[email protected]>

CONTRIBUTORS

Nils Diewald (Akron)

BUGS

Please report any bugs or feature requests to bug-mojolicious-plugin-gravatar at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mojolicious-Plugin-Gravatar. 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 https://github.com/koorchik/Mojolicious-Plugin-Gravatar/

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Mojolicious::Plugin::Gravatar

You can also look for information at:

ACKNOWLEDGEMENTS

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.

mojolicious-plugin-gravatar's People

Contributors

koorchik avatar akron avatar

Watchers

James Cloos avatar David Steinbrunner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.