Skip to content

Commit

Permalink
Don’t generate sitemaps when crawling is disabled (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Oct 30, 2024
1 parent 385aa3d commit 68186a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Commands/GenerateSitemaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public function handle()
return error('The sitemap feature is disabled. You need to enable it to generate the sitemaps.');
}

if (! in_array(app()->environment(), config('advanced-seo.crawling.environments', []))) {
return error('The current environment is protected from being crawled. To generate the sitemaps, you need to add this environment to the crawling config.');
}

$this->shouldQueue = $this->option('queue');

if ($this->shouldQueue && config('queue.default') === 'sync') {
Expand Down

0 comments on commit 68186a2

Please sign in to comment.