composer require refresh sitemap, config for sitemap
This commit is contained in:
parent
bf208d3c17
commit
bf86a009f8
3 changed files with 946 additions and 80 deletions
|
|
@ -14,6 +14,7 @@
|
|||
"joedixon/laravel-translation": "^1.1",
|
||||
"kwaadpepper/enum": "^2.1",
|
||||
"kwaadpepper/exception-handler": "^0.0.9",
|
||||
"kwaadpepper/refresh-sitemap": "^1.0",
|
||||
"laravel/framework": "^8.65",
|
||||
"laravel/tinker": "^2.5",
|
||||
"laravel/ui": "^3.3",
|
||||
|
|
|
|||
909
composer.lock
generated
909
composer.lock
generated
File diff suppressed because it is too large
Load diff
116
config/refresh-sitemap.php
Normal file
116
config/refresh-sitemap.php
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Gamme;
|
||||
use App\Models\Product;
|
||||
use Spatie\Sitemap\Tags\Url;
|
||||
|
||||
return [
|
||||
|
||||
/**
|
||||
* A list of url to ignore
|
||||
* These are hard coded
|
||||
* Each url does not have to be exhaustive
|
||||
*
|
||||
* For example, if you want to ignore all routes
|
||||
* of the backoffice group
|
||||
* just add '/backoffice' into this table
|
||||
*/
|
||||
'ignoreRoutes' => [
|
||||
'/bo',
|
||||
'/en',
|
||||
'/es'
|
||||
],
|
||||
|
||||
/**
|
||||
* This table is needed to resolve models matching
|
||||
* routes
|
||||
*
|
||||
* it has to be filled like following
|
||||
*
|
||||
* 'products.meat-type' => [
|
||||
* 'slugMeatType' => [MeatTypes::class, 'slug']
|
||||
* ],
|
||||
* 'kitchen-side.health-nutrition.balanced-menu.menu' => [
|
||||
* 'type' => [BalancedMenuType::class, 'type']
|
||||
* ]
|
||||
*
|
||||
* The index is the complete route name, the array content is an array
|
||||
* within index is the argument name with its model class.
|
||||
* This will allow the generator to generate a route for each of the models
|
||||
* in this table
|
||||
*/
|
||||
'routesBinder' => [
|
||||
'gammes.show' => [
|
||||
'gammeSlug' => [Gamme::class, 'slug'],
|
||||
],
|
||||
'product.show' => [
|
||||
'gammeSlug' => [Gamme::class, 'slug'],
|
||||
'productSlug' => [Product::class, 'slug']
|
||||
]
|
||||
],
|
||||
|
||||
/**
|
||||
* You can put route conditions here
|
||||
* These will be used to decide whether the route should appear
|
||||
* in the sitemap or not
|
||||
*
|
||||
* These are called in Eloquent where
|
||||
*
|
||||
* example
|
||||
*
|
||||
* 'queryConditions' => [
|
||||
* 'status' => true,
|
||||
* 'ocbStatus' => EleveurOcbStatus::yes()->value,
|
||||
* 'star_moment' => true
|
||||
* ]
|
||||
*
|
||||
*/
|
||||
'queryConditions' => [],
|
||||
|
||||
/**
|
||||
* The default route frequency to use with sitemap generator
|
||||
*/
|
||||
'routeDefaultFrequency' => Url::CHANGE_FREQUENCY_DAILY,
|
||||
|
||||
/**
|
||||
* The default route priority to use with sitemap generator
|
||||
*
|
||||
* priority should be a number between 0 and 1
|
||||
* https://www.sitemaps.org/protocol.html
|
||||
*/
|
||||
'routeDefaultPriority' => 0.5,
|
||||
|
||||
/**
|
||||
* Frequencies for routes
|
||||
* use the full or partial route name as index
|
||||
* and a frequency within \Spatie\Sitemap\Tags\Url constants
|
||||
*/
|
||||
'routeFrequencies' => [],
|
||||
|
||||
/**
|
||||
* Priorities for routes
|
||||
* use the full or partial route name as index
|
||||
* and a priority number between 0 and 1
|
||||
*/
|
||||
'routePriorities' => [],
|
||||
|
||||
/**
|
||||
* Enable or disable schedule for the job
|
||||
* If set to true the sitemap generator will be run
|
||||
* using the 'cron' instruction
|
||||
*/
|
||||
'schedule' => false,
|
||||
|
||||
/**
|
||||
* 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/
|
||||
* https://laravel.com/docs/8.x/scheduling#schedule-frequency-options
|
||||
*
|
||||
* schedule must be set to true
|
||||
*
|
||||
* Default is every day at 15:45
|
||||
*/
|
||||
'cron' => '45 15 * * *'
|
||||
];
|
||||
Loading…
Add table
Reference in a new issue