actuel-inactuel/site/config/config.php
2024-03-12 17:12:03 +01:00

84 lines
2.2 KiB
PHP

<?php
use Kirby\Uuid\Uuid;
return [
'debug' => true,
'panel' => [
'menu' => [
'site' => [
'label' => 'Accueil',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'site');
}
],
'texts' => [
'icon' => 'pen',
'label' => 'Textes',
'link' => 'pages/texts',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/texts');
}
],
'-',
'-',
'infos' => [
'icon' => 'question',
'label' => 'À propos',
'link' => 'pages/a-propos',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/a-propos');
}
],
'newsletter' => [
'icon' => 'email',
'label' => 'Infolettre',
'link' => 'pages/lettre',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/lettre');
}
],
'-',
'-',
'users',
'comments',
'admin' => [
'icon' => 'folder',
'label' => 'Administration',
'link' => 'pages/admin',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/admin');
}
],
'-',
'-',
'system',
]
],
'routes' => [
[
'pattern' => 'auteurs/(:any)',
'action' => function ($slug) {
$kirby = kirby();
$author = getAuthorBySlug($slug);
return Page::factory([
'slug' => '',
'template' => 'author',
'model' => 'authors',
'content' => [
'title' => $author->name(),
'presentation' => $author->presentation(),
'author' => $author->name(),
'uuid' => Uuid::generate(),
]
]);
}
]
]
];