julienmonnerie/site/config/config.php
2025-05-04 18:29:19 +02:00

64 lines
2.2 KiB
PHP

<?php
return [
// Kirby configuration settings
'panel' => [
'css' => 'build/panel.css',
'install' => true,
'language' => 'fr',
'menu' => [
'site' => [
'current' => function (string $current): bool { // Override default menu entry highlighting
$links = [ // Links of all custom menu entries
'pages/media-library',
];
$path = Kirby\Cms\App::instance()->path();
return $current === 'site' && A::every($links, fn ($link) => Str::contains($path, $link) === false);
},
],
'-',
'media-library' => [
'icon' => 'images',
'label' => [
'en' => 'Media library',
'fr' => 'Médiathèque',
],
'link' => 'pages/media-library',
'current' => function (string $current): bool { // Override default menu entry highlighting
$path = Kirby\Cms\App::instance()->path();
return Str::contains($path, 'pages/media-library');
},
],
'users',
'system',
]
],
// Sitemapper plugin options
'kirbyzone.sitemapper' => [
'intro' => false,
'byLine' => 'Sitemap generated with <a href="https://github.com/kirbyzone/sitemapper" target="_blank">Sitemapper by Kirbyzone</a>.'
],
// Hooks
'hooks' => [
'file.create:after' => function($file) {
// Populate file_type field with $file->type() method after file creation
if ($file->type()) {
$file->update([
'file_type' => $file->type()
]);
}
}
],
// Thumbnails and srcsets presets
'thumbs' => [
'srcsets' => [
'default' => [
'640w' => ['width' => 640, 'quality' => 80],
'1280w' => ['width' => 1280, 'quality' => 80],
'1920w' => ['width' => 1920, 'quality' => 80],
'2560w' => ['width' => 2560, 'quality' => 80],
'3840w' => ['width' => 3840, 'quality' => 80]
]
]
]
];