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 π
http://realfavicongenerator.net.https://css-tricks.com/favicon-quiz/.Mojolicious::Plugin::AssetPack.
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
- opensuse-leap 16.0: perl-Mojolicious-Plugin-AssetPack 2.150.0-bp160.1.11 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms