Mojolic...:Favicon(3)

πŸ’… NAME πŸ’…

Okay so welcome to Mojolic...:Favicon(3), bestie β€” the User Contributed Perl Documentation for Mojolicious::Plugin::AssetPack::Pipe::Favicon. This page is literally about generating favicons. Iconic behavior only, no cap. ✨

🌸 SYNOPSIS 🌸

πŸŽ€ Application πŸŽ€

Set it up like this:

plugin AssetPack => {pipes => ["Favicon"]};
app->asset->pipe("Favicon")->api_key("fd27cc5654345678765434567876545678765556");
app->asset->process("favicon.ico" => "images/favicon.png");

# Can also register variations of the favicon:
app->asset->process("favicon.variant1.ico" => "images/favicon1.png");
app->asset->process("favicon.variant2.ico" => "images/favicon2.png");

Heads up: the topic has to be either favicon.ico or favicon.some_identifier.ico β€” no random names, okay? πŸ™ˆ

For bestie-level results, your input image file should be a 260x260 PNG file. That's the optimal vibe. πŸ’–

πŸ¦‹ Template πŸ¦‹

The way this template line just works:

%= asset "favicon.ico"

That little line above will expand to whatever HTML http://realfavicongenerator.net has generated, based on design. Example:

<link rel="icon" type="image/png" href="/asset/52eaz7613a/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/asset/65428718f1/favicon-32x32.png" sizes="32x32">
<link rel="apple-touch-icon" sizes="114x114" href="/asset/9aab8718f1/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="152x152" href="/asset/feee661542/apple-touch-icon-152x152.png">
<meta name="msapplication-square310x310logo" content="/asset/123ab718f1/largelogo.png">
<meta name="msapplication-wide310x150logo" content="/asset/a827bfddf0/widelogo.png">

By default this pipe will only create desktop icons. If you want more icons, configure design. Simple as that. πŸŽ€

✨ DESCRIPTION ✨

Mojolicious::Plugin::AssetPack::Pipe::Favicon uses http://realfavicongenerator.net to generate all the different favicons that is required for your site. It's giving effortless icon factory realness. 🌈

This pipe is EXPERIMENTAL. Let me know if you are using it. πŸ‘€

πŸ‘‘ ATTRIBUTES πŸ‘‘

πŸ”‘ api_key

$self = $self->api_key($key);
$str = $self->api_key;

This is an API key obtained from http://realfavicongenerator.net/api/. Keep it safe, bestie. πŸ’…

🎨 design

$hash = $self->design;
$self = $self->design({desktop_browser => {}, ios => {}, windows => {}});

Use this to customize the different designs. Look for favicon_design on http://realfavicongenerator.net/api/non_interactive_api for details. It's giving customizable icon aesthetics. πŸ¦‹

βš™οΈ settings

$hash = $self->settings;
$self = $self->settings({compression => 3});

Use this to customize the different settings. Look for settings on http://realfavicongenerator.net/api/non_interactive_api for details. Yes, compression => 3 is right there. 🫢

πŸ› οΈ METHODS πŸ› οΈ

🧚 process

See "process" in Mojolicious::Plugin::AssetPack::Pipe. That's the one. πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€


Source/version and date check before I go: perl v5.42.0, 2024-12-12, Mojolic...:Favicon(3) β€” mwah, bye bestie! πŸ’–πŸŽ€

πŸ“¦ where this page comes from