Mity Docs Mity Docs for Mity Digital
Sitemapamic Documentation

Content discovery

Sitemapamic decides which Collections and Taxonomies go into your sitemap with the collections and taxonomies options in config/sitemapamic.php.

1'collections' => ['*'],
2'taxonomies' => ['*'],

Out of the box, every Collection and Taxonomy is discovered automatically, including Taxonomies configured for Collections. For most sites, that's all you need.

Collections

Every Collection

'*' selects every Collection. Each one's attached Taxonomies are included too, so a blog Collection with tags attached also lists its contextual term pages, such as /blog/tags/laravel.

1'collections' => ['*'],

Every Collection except some

Keep '*' and set a Collection's handle to false to leave it out:

1'collections' => [
2 '*',
3 'support' => false,
4],

This discovers every Collection except support, even if support has a route.

Only some Collections

Without '*', list the handles you want. A plain handle selects that Collection's entries only: its attached Taxonomies are not included.

1'collections' => [
2 'pages',
3 'blog',
4],

Choosing a Collection's Taxonomies

Give a Collection a taxonomies key to choose which of its attached Taxonomies are listed:

1'collections' => [
2 'pages',
3 'blog' => [
4 'taxonomies' => [
5 'tags',
6 ],
7 ],
8],

This lists pages entries, blog entries, and the blog Collection's tags term pages, even if blog has other Taxonomies attached.

Use '*' inside taxonomies to list every Taxonomy attached to that Collection, or an empty array for none:

1'collections' => [
2 '*',
3 'blog' => [
4 'taxonomies' => ['*'],
5 ],
6 'news' => [
7 'taxonomies' => [],
8 ],
9],

A Taxonomy listed here must actually be attached to the Collection, or it is skipped.

A Collection can also set its own changefreq and priority defaults. See Defaults.

Taxonomies

The taxonomies option controls each Taxonomy's own term pages, such as /tags/laravel. These are separate from the contextual term pages a Collection lists.

It works the same way as collections:

1// every Taxonomy
2'taxonomies' => ['*'],
3 
4// every Taxonomy except "internal"
5'taxonomies' => [
6 '*',
7 'internal' => false,
8],
9 
10// only "tags" and "categories"
11'taxonomies' => [
12 'tags',
13 'categories',
14],
15 
16// no Taxonomy term pages
17'taxonomies' => [],

A Taxonomy can set its own changefreq and priority defaults too. Its handle is included when you give it options, even without '*':

1'taxonomies' => [
2 'tags' => [
3 'changefreq' => 'weekly',
4 ],
5],

What gets listed

Discovery only chooses where to look. Each entry and term is then checked before it is added.

A Collection is skipped on a site when it isn't available on that site, or has no route for it.

An entry is listed only when:

  • it is published

  • its date is visible, for dated Collections whose past or future dates are set to private or unlisted

  • it is not excluded with the include field (see Blueprints)

  • it is not a redirect

  • it is not protected

  • it has a URL

  • its template exists

A term is listed only when:

  • its Taxonomy is available on the site

  • it is not excluded with the include field

  • it is not a redirect

  • it is not protected

  • it has a URL

  • its template exists

  • at least one published, visible entry on that site uses it

For a contextual term page, that entry must be in the same Collection. A term's lastmod is the later of its own last modified date and its newest entry's.

Multi-site

Discovery runs separately for each site, and each site gets its own sitemap. A Collection or Taxonomy only appears in a site's sitemap when it is available on that site.

When an entry has localisations on other sites, Sitemapamic adds hreflang alternate links between them automatically. Only localisations that would be listed themselves are linked.

Mounted Collections

When a Collection is mounted on another Collection's entry, its URLs depend on that entry. Saving an entry in the mounting Collection rebuilds the sitemap for every site, so mounted URLs stay correct.