Skip to content

Commit

Permalink
Make BrowserShot Optional in SitemapGenerator (#558)
Browse files Browse the repository at this point in the history
* Remove the crawler dependencies and make them optional

* Add to the docs and remove the symphony suggestion

* Add spatie/crawler to require-dev

* Improve docs

---------

Co-authored-by: Antonio Ribeiro <[email protected]>
  • Loading branch information
antonioribeiro and Antonio Ribeiro authored Jan 6, 2025
1 parent ba76c38 commit 7ee63b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ composer require spatie/laravel-sitemap

The package will automatically register itself.

If you intend to use the crawler to generate your sitemap using `SitemapGenerator::create(...)`, you also need to install the [Spatie's Crawler](https://github.com/spatie/crawler) package:

``` bash
composer require spatie/crawler
```

If you want to update your sitemap automatically and frequently you need to perform [some extra steps](https://github.com/spatie/laravel-sitemap#generating-the-sitemap-frequently).

## Configuration
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
"guzzlehttp/guzzle": "^7.8",
"illuminate/support": "^10.0|^11.0",
"nesbot/carbon": "^2.71|^3.0",
"spatie/crawler": "^8.0.1",
"spatie/laravel-package-tools": "^1.16.1",
"symfony/dom-crawler": "^6.3.4|^7.0"
"spatie/laravel-package-tools": "^1.16.1"
},
"require-dev": {
"mockery/mockery": "^1.6.6",
"orchestra/testbench": "^8.14|^9.0",
"pestphp/pest": "^2.24",
"spatie/crawler": "^8.4",
"spatie/pest-plugin-snapshots": "^2.1",
"spatie/phpunit-snapshot-assertions": "^5.1.2",
"spatie/temporary-directory": "^2.2"
Expand All @@ -45,6 +44,9 @@
]
}
},
"suggest": {
"spatie/crawler": "Required to use the crawler feature"
},
"autoload": {
"psr-4": {
"Spatie\\Sitemap\\": "src"
Expand Down

0 comments on commit 7ee63b6

Please sign in to comment.