Rapidez sitemap index through Eventy filters
composer require rapidez/sitemap
You can publish the views with:
php artisan vendor:publish --tag=rapidez-sitemap-views
If you have additional indexes, such as CMS pages or other custom routes, you can dynamically add them to your sitemap index based on the Store ID using the rapidez.site.{storeId}
filter provided by Eventy.
To do this, simply add the following code to the appropriate place in your application (e.g., in a service provider or a dedicated sitemap configuration file):
use TorMorten\Eventy\Facades\Eventy;
Eventy::addFilter('rapidez.sitemap.{storeId}', function ($sitemaps) {
// Add your custom sitemap URL here
$sitemaps[] = [
'loc' => url('/some-dynamic-url.xml'),
'lastmod' => now()->toDateTimeString(),
];
return $sitemaps;
});
With this filter in place, the URL /some-dynamic-url.xml
will be added to your sitemap index, allowing you to dynamically include additional sections of your site, such as CMS-generated pages, product categories, or other custom data sources.
GNU General Public License v3. Please see License File for more information.