Add default ignore routes

This commit is contained in:
Jérémy Munsch 2023-05-22 16:12:45 +02:00
parent 4fdae6d0e9
commit f5e949bbd8
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 10 additions and 1 deletions

View file

@ -23,6 +23,15 @@ final class SitemapGenerator
/** @var \Spatie\Sitemap\Sitemap */
private $siteMap = null;
/**
* Default routes to ignore
*
* @var string[]
*/
private static $defaultIgnoreRoutes = [
'ignition.'
];
/**
* SitemapGenerator
*/

View file

@ -36,7 +36,7 @@ trait SitemapRouteConditions
throw new \Error('ignoreRoutes can take only string with route name or url');
}
return $value;
});
})->concat(static::$defaultIgnoreRoutes);
self::$queryConditions = \collect(\config('refresh-sitemap.queryConditions', self::$queryConditions))
->mapWithKeys(function ($value, $index) {
if (!\is_string($index) or !(\is_string($value) || \is_bool($value))) {