# Sitemap

## TLDR

Default behavior is set in entity config.

```yaml
auto_admin:
    content:
        contents:
            # [...]
            App\Entity\Article:
                # [...]
                sitemap:
                    # disable: true
                    section: article
                # [...]
# [...]
```

Global config can be used to add routes to one of the sitemaps.

```yaml
auto_admin:
    content:
        sitemap:
            # [...]
            routes:
                default:
                    -   route: 'page_view'
                        param: { slugAdmin: 'news' }
                page:
                    - { name: 'home', param: { myparam: 'myvalue' } }
            # [...]
# [...]
```

Complex configuration can be done using [AbstractSitemapBuilder](../../src/Seo/Sitemap/AbstractSitemapBuilder.php).

Don't forget to tag your custom builders with `aa_seo.sitemap_builder`

---

## Introduction

Permit to describe how entities are retrieved and organized in the site sitemap and sitemap sections.

## Principle

A default SitemapBuilder is handling config-related sitemap entries.
A global config can be used to add routes to one of the sitemaps.
Additional SitemapBuilder can be added in app to add complex structures.

Cache is generated on cache warmup (a cache:clear without options will build cached sitemaps).
Caching is done following domain & language constraints, as /robots.txt is on a root url, we possibly (depending on
language matrix) retrieve all languages for given domain.


## Whole section disabling

```yaml
auto_admin:
    content:
        # [...]
        sitemap:
          config:
            # section slug we want to disable
            default:
              disable: true
```