Skip to content

Commit

Permalink
Allow sitemap generator to follow redirects (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexxai authored Aug 7, 2024
1 parent c6f0b19 commit 55cf923
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions config/sitemap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

use GuzzleHttp\RequestOptions;
use Spatie\Sitemap\Crawler\Profile;

return [

/*
* These options will be passed to GuzzleHttp\Client when it is created.
* For in-depth information on all options see the Guzzle docs:
*
* http://docs.guzzlephp.org/en/stable/request-options.html
*/
'guzzle_options' => [

/*
* Whether or not cookies are used in a request.
*/
RequestOptions::COOKIES => true,

/*
* The number of seconds to wait while trying to connect to a server.
* Use 0 to wait indefinitely.
*/
RequestOptions::CONNECT_TIMEOUT => 10,

/*
* The timeout of the request in seconds. Use 0 to wait indefinitely.
*/
RequestOptions::TIMEOUT => 10,

/*
* Describes the redirect behavior of a request.
*/
RequestOptions::ALLOW_REDIRECTS => true,
],

/*
* The sitemap generator can execute JavaScript on each page so it will
* discover links that are generated by your JS scripts. This feature
* is powered by headless Chrome.
*/
'execute_javascript' => false,

/*
* The package will make an educated guess as to where Google Chrome is installed.
* You can also manually pass its location here.
*/
'chrome_binary_path' => null,

/*
* The sitemap generator uses a CrawlProfile implementation to determine
* which urls should be crawled for the sitemap.
*/
'crawl_profile' => Profile::class,

];

0 comments on commit 55cf923

Please sign in to comment.