Files
kirby-fontawesome/index.php

58 lines
2.1 KiB
PHP

<?php
/**
* Copyright 2026, Dreytac <dreytac@hobbyhome.net>
*
* This file is part of Kirby Font Awesome.
*
* Kirby Font Awesome is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
*
* Kirby Font Awesome is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with Kirby Font Awesome. If not, see <https://www.gnu.org/licenses/>.
*/
Kirby::plugin(
name: "hobbyhome/fontawesome",
extends: [
"options" => [
"assets" => [
"css" => [
150 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/fontawesome/css/fontawesome" . r(!option("debug"), ".min") . ".css", true),
151 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/fontawesome/css/regular" . r(!option("debug"), ".min") . ".css", true),
152 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/fontawesome/css/solid" . r(!option("debug"), ".min") . ".css", true),
153 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/fontawesome/css/brands" . r(!option("debug"), ".min") . ".css", true),
],
],
],
"hooks" => [
/**
* To add this hook to a plugin, change the option() call to use the plugins name.
*
* @version 1.0
*/
"hobbyhome.getAssets" => function ($files = [], $type = "css") {
foreach (option("hobbyhome.fontawesome.assets.{$type}", []) as $order => $file) {
# Make sure no other file exists with the current sort order index.
while (isset($files[$order])) {
$order++;
}
$files[$order] = $file;
}
return $files;
},
],
],
info: [
"authors" => [[
"name" => "Dreytac",
"email" => "dreytac@hobbyhome.net",
"homepage" => "https://hobbyhome.net",
]],
"license" => "AGPL-3.0-only",
"version" => "0.0.0",
# "bootstrap" => "7.2.0",
],
);