ldc-bien-etre-animal/config/sitemap-generator.php
Jérémy Munsch 1a148767bc
chore(sitemap): set default value for SITEMAP_STORAGE_DISK_NAME
This change ensures that the sitemap generation uses 'local' as the default storage disk if no environment variable is set.
2026-10-15 16:01:03 +02:00

114 lines
3.1 KiB
PHP

<?php
declare(strict_types=1);
$routesFront = (require __DIR__ . '/../lang/fr/routes.php')['front'];
$actualitesSinglePages = array_map(
fn ($key) => "front.{$key}",
array_filter(
array_keys($routesFront),
fn ($key) => str_starts_with((string) $key, 'actualites-')
)
);
$communitySinglePages = array_map(
fn ($key) => "front.{$key}",
array_filter(
array_keys($routesFront),
fn ($key) => str_starts_with((string) $key, 'qui-sommes-nous-')
)
);
return [
/**
* Single route names
*
* Ex:
*
* 'singlePages' => [
* 'homepage',
* ],
*/
'single_pages' => [
'front.homepage',
'front.why-this-approach',
'front.animal-welfare',
'front.engagements',
'front.espace-presse',
'front.contact',
'front.rejoindre-le-collectif',
'front.questions-reponses',
'front.mentions-legales',
'front.charte-de-confidentialite',
'front.actualites',
...$actualitesSinglePages,
'front.qui-sommes-nous-gouvernance',
...$communitySinglePages,
],
/**
* Model namespaces with filters
*
* Ex: (modelFilters & relationFilters are not necessaries)
* 'cruds' => [
* [
* 'model' => 'App\Models\Product',
* 'modelFilters' => [
* ['published', '=', true]
* ],
* 'relationFilters' => [
* 'range' => fn(Builder $q) => $q->where('status', true),
* ],
* 'allowNullRelations' => ['range'],
* ],
* [
* 'model' => 'App\Models\Article',
* ]
* ],
*/
'cruds' => [],
/**
* Enable or disable schedule for the job
* If set to true the sitemap generator will be run
* using the 'cron' instruction
*/
'schedule' => true,
/**
* If you want to set specific
* instruction for when to schedule job
* you can set this with a cron instruction
* You can generate one using https://crontab.guru/
*
* schedule must be set to true
*
* Default is every day at 15:45
*/
'cron' => '45 15 * * *',
/**
* All supported locales in the project.
* When used with mcamara/laravel-localization, you can get the values from the package config :
* 'supported_locales' => array_keys(config('laravellocalization.supportedLocales', ['fr' => "Fr"]))
*/
'supported_locales' => array_keys(config('laravellocalization.supportedLocales', ['fr' => 'Fr'])),
/**
* The location where the sitemap file should be generated.
*/
'output' => [
'storage_disk' => env('SITEMAP_STORAGE_DISK_NAME', 'local'),
'path' => 'sitemap.xml',
],
/**
* The route localizer strategy to use.
* Supported: 'default', 'mcamara', or a custom class implementing RouteLocalizerInterface.
* When null or omitted, auto-detects if Mcamara is registered in the application,
* otherwise falls back to 'default'.
*/
'localizer' => 'mcamara',
];