Refactor: config Kirby scindée en menu.php + thumbs.php
All checks were successful
Deploy / Deploy to Production (push) Successful in 17s
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>
This commit is contained in:
parent
0ea4bfe539
commit
d42217fd20
3 changed files with 98 additions and 135 deletions
36
site/config/menu.php
Normal file
36
site/config/menu.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?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',
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue