58 lines
1.8 KiB
PHP
58 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* Copyright 2026, Dreytac <dreytac@hobbyhome.net>
|
|
*
|
|
* This file is part of Kirby Bootstrap.
|
|
*
|
|
* Kirby Bootstrap 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 Bootstrap 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 Bootstrap. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
Kirby::plugin(
|
|
name: "hobbyhome/bootstrap",
|
|
extends: [
|
|
"options" => [
|
|
"assets" => [
|
|
"css" => [
|
|
100 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/bootstrap/css/bootstrap" . r(!option("debug"), ".min") . ".css", true),
|
|
],
|
|
"jsHeader" => [
|
|
100 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/bootstrap/js/bootstrap.bundle" . r(!option("debug"), ".min") . ".js", 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.bootstrap.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" => "1.0.0",
|
|
# "bootstrap" => "5.3.8",
|
|
],
|
|
);
|