From a804c973898547da3c393b46a0c447dc4ff91eca Mon Sep 17 00:00:00 2001 From: Abdessamad Bettal | Freelancer <93977120+abdessamadbettal@users.noreply.github.com> Date: Sat, 14 Dec 2024 10:27:35 +0000 Subject: [PATCH] Update sitemap generation to exclude additional no-index paths and remove deprecated route --- app/Console/Commands/GenerateSitemap.php | 13 ++++++++++++- routes/web.php | 6 ------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Console/Commands/GenerateSitemap.php b/app/Console/Commands/GenerateSitemap.php index 6175959..2a56888 100644 --- a/app/Console/Commands/GenerateSitemap.php +++ b/app/Console/Commands/GenerateSitemap.php @@ -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/*', ]; /** diff --git a/routes/web.php b/routes/web.php index 25e420b..9f16450 100644 --- a/routes/web.php +++ b/routes/web.php @@ -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(),