Release License Starts Forks Issues Coverage Status

Mojolicious::Plugin::Badge - Badge plugin for Mojolicious

Mojolicious::Plugin::Badge is a Mojolicious plugin that generate "Shields.io" like badge from badge helper or via API URL (e.g. /badge/Hello-Mojo!-orange).

Usage

Create your badge ...

... in Mojolicious or Mojolicious::Lite application:

# Mojolicious
$self->plugin('Badge');

# Mojolicious::Lite
plugin 'Badge';

get '/my-cool-badge' => sub ($c) {

  my $badge = $c->app->badge(
    label        => 'Hello',
    message      => 'Mojo!',
    color        => 'orange'
    logo         => 'https://docs.mojolicious.org/mojo/logo.png'
    badge_format => 'png',
  );

  $c->render(data => $badge, format => 'png');

};

... via "Shields.io"-like Badge API:

GET /badge/Hello-Mojo!-orange.png

... from CLI using "badge" command:

./myapp.pl badge --label "Hello" --message "Mojo!" --color "orange" --format png --file my-cool-badge.png

Output:

Hello Mojo

Styles

Colors

blue brightgreen green grey lightgrey orange red yellow yellowgreen

Installation

To install this module type the following:

perl Makefile.PL
make
make test
make install

Using App::cpanminus:

cpanm Mojolicious::Plugin::Badge

Documentation

Copyright (C) 2024 by Giuseppe Di Terlizzi