All checks were successful
Deploy / Deploy to Production (push) Successful in 17s
- menu.php: helper menuItem() — détection active mutualisée - thumbs.php: helpers srcsetPreset/srcsetPair — widths définis une seule fois, paires normal/webp générées automatiquement sans duplication - config.php: réduit à l'essentiel via require Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Helper : génère un item de menu avec détection automatique du lien actif.
|
|
*/
|
|
function menuItem(string $id, string $label, string $icon, string $link): array
|
|
{
|
|
return [
|
|
'label' => $label,
|
|
'icon' => $icon,
|
|
'link' => $link,
|
|
'current' => function () use ($link): bool {
|
|
return Str::contains(Kirby\Cms\App::instance()->path(), $link);
|
|
},
|
|
];
|
|
}
|
|
|
|
return [
|
|
'site' => [
|
|
'label' => 'Données partagées',
|
|
'icon' => 'cog',
|
|
'current' => function (): bool {
|
|
return Str::contains(Kirby\Cms\App::instance()->path(), '/site');
|
|
},
|
|
],
|
|
'-',
|
|
'home' => menuItem('home', 'Accueil', 'home', 'pages/home'),
|
|
'expertise' => menuItem('expertise', 'Expertise','wand', 'pages/expertise'),
|
|
'portfolio' => menuItem('portfolio', 'Portfolio','images', 'pages/portfolio'),
|
|
'jouer' => menuItem('jouer', 'Jouer', 'play', 'pages/jouer'),
|
|
'a-propos' => menuItem('a-propos', 'À propos', 'users', 'pages/a-propos'),
|
|
'blog' => menuItem('blog', 'Blog', 'text', 'pages/blog'),
|
|
'-',
|
|
'users',
|
|
'system',
|
|
];
|