Sitemaps

Sitemap Indexes

The Sitemap extension separates all sitemaps into indexes. Indexes are organized by stream generally.

Defining A Sitemap

To get started first create a resources/config/sitemap.php file in your addon and add your sitemaps by key and repository.

The key will be used in the sitemap URL.

<?php

return [
    'categories' => \Anomaly\PostsModule\Category\CategoryRepository::class,
    'posts'      => \Anomaly\PostsModule\Post\Contract\PostRepositoryInterface::class,
];

This will add the sitemaps to your sitemap.xml index:

<sitemap>
    <loc>
        https://yoursite.com/sitemap/anomaly.module.documentation/pages.xml
    </loc>
    <lastmod>2019-04-09T10:44:17-05:00</lastmod>
</sitemap>
<sitemap>
    <loc>
        https://yoursite.com/sitemap/anomaly.module.posts/categories.xml
    </loc>
    <lastmod>2016-04-21T19:02:13-05:00</lastmod>
</sitemap>