index-main/site/config/config.php

115 lines
3.8 KiB
PHP
Raw Normal View History

2025-10-07 16:21:26 +02:00
<?php
return [
'debug' => true,
'languages' => true,
2026-01-13 10:57:17 +01:00
'date.handler' => 'intl',
2026-02-27 14:33:49 +01:00
// 'auth' => [
// 'methods' => [
// 'password' => ['2fa' => true]
// ]
// ],
2025-10-07 16:21:26 +02:00
'thumbs' => [
'quality' => 80,
'presets' => [
'grid' => 400,
'default' => [
'width' => 1024, 'format' => 'webp'
],
'full' => 2048,
'format' => 'webp'
],
'srcsets' => [
'default' => [200, 400, 600, 800, 1024, 1440, 2048],
'webp' => [
'300w' => ['width' => 300, 'format' => 'webp'],
'600w' => ['width' => 600, 'format' => 'webp'],
'900w' => ['width' => 900, 'format' => 'webp'],
'1200w' => ['width' => 1200, 'format' => 'webp'],
],
// Cover cards investigations : 465px fixe ≥1000px, 50vw 7281000px, 100vw <728px
// Widths couvrent 1x et 2x (retina) pour chaque breakpoint
'cover-card' => [465, 728, 930, 1000, 1456],
'cover-card-webp' => [
'465w' => ['width' => 465, 'format' => 'webp'],
'728w' => ['width' => 728, 'format' => 'webp'],
'930w' => ['width' => 930, 'format' => 'webp'],
'1000w' => ['width' => 1000, 'format' => 'webp'],
'1456w' => ['width' => 1456, 'format' => 'webp'],
2025-10-07 16:21:26 +02:00
],
// Hero cover investigation : 940px fixe ≥1000px, 90vw en dessous
'cover-hero' => [680, 940, 1200, 1880],
'cover-hero-webp' => [
'680w' => ['width' => 680, 'format' => 'webp'],
'940w' => ['width' => 940, 'format' => 'webp'],
'1200w' => ['width' => 1200, 'format' => 'webp'],
'1880w' => ['width' => 1880, 'format' => 'webp'],
],
// Body 1 colonne : 100vw
'body-full' => [750, 1000, 1440, 1880],
'body-full-webp' => [
'750w' => ['width' => 750, 'format' => 'webp'],
'1000w' => ['width' => 1000, 'format' => 'webp'],
'1440w' => ['width' => 1440, 'format' => 'webp'],
'1880w' => ['width' => 1880, 'format' => 'webp'],
],
// Body 2 colonnes : 50vw ≥768px, 90vw en dessous
'body-half' => [680, 720, 1000, 1380, 1440],
'body-half-webp' => [
'680w' => ['width' => 680, 'format' => 'webp'],
'720w' => ['width' => 720, 'format' => 'webp'],
'1000w' => ['width' => 1000, 'format' => 'webp'],
'1380w' => ['width' => 1380, 'format' => 'webp'],
'1440w' => ['width' => 1440, 'format' => 'webp'],
],
2025-10-07 16:21:26 +02:00
],
],
2025-11-04 09:05:55 +01:00
'panel' => [
2026-02-27 14:25:08 +01:00
'menu' => require_once __DIR__ . '/menu.php',
'css' => '/assets/css/panel.css'
],
'donorbox' => [
'api_key' => '', // À remplir avec la clé API Donorbox
'campaign_slug' => 'soutenir-index-en-2024',
'campaign_url' => 'https://donorbox.org/soutenir-index-en-2024',
'api_base_url' => 'https://donorbox.org/api/v1'
],
2026-02-14 17:29:27 +01:00
'tobimori.seo.canonicalBase' => 'https://www.index.ngo',
'hooks' => [
'page.update:after' => function ($newPage) {
if ($newPage->intendedTemplate()->name() !== 'investigation') {
return;
}
$database = page('database');
if (!$database) {
return;
}
$fields = [
'keywords' => 'keywords',
'incidentCountry' => 'countries',
];
$updated = false;
$data = [];
foreach ($fields as $investigationField => $dbField) {
$newValues = $newPage->content()->get($investigationField)->split();
$existingValues = $database->content()->get($dbField)->split();
$merged = array_unique(array_merge($existingValues, $newValues));
if (count($merged) > count($existingValues)) {
$data[$dbField] = implode(', ', $merged);
$updated = true;
}
}
if ($updated) {
kirby()->impersonate('kirby');
$database->update($data);
}
}
]
2025-10-07 16:21:26 +02:00
];