Skip to content

Commit

Permalink
Update sitemap generation to exclude additional no-index paths and re…
Browse files Browse the repository at this point in the history
…move deprecated route
  • Loading branch information
abdessamadbettal committed Dec 14, 2024
1 parent 5e2bf9e commit a804c97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 12 additions & 1 deletion app/Console/Commands/GenerateSitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ class GenerateSitemap extends Command

private array $noIndexPaths = [
'',
'/forum/*',
'/login/github',
'/login/google',
'/login/facebook',
'/login/twitter',
'/login',
'/register',
'/password/reset',
'/password/confirm',
'/password/email',
'/forgot-password',
'/reset-password/*',
'/email/verify',
'/user/*',
'/profile/*',
];

/**
Expand Down
6 changes: 0 additions & 6 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;


Route::get('/sitemap.xml', function () {
return \Spatie\Sitemap\Sitemap::create()
->add(\Spatie\Sitemap\Tags\Url::create('/'))
->add(\Spatie\Sitemap\Tags\Url::create('/about'))
->writeToFile(public_path('sitemap.xml'));
});
Route::group(
[
'prefix' => LaravelLocalization::setLocale(),
Expand Down

0 comments on commit a804c97

Please sign in to comment.