Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.28 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.28 KB

Rapidez sitemap

Rapidez sitemap index through Eventy filters

Installation

composer require rapidez/sitemap

Views

You can publish the views with:

php artisan vendor:publish --tag=rapidez-sitemap-views

Adding Additional Sitemap Indexes with Eventy

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.

License

GNU General Public License v3. Please see License File for more information.