pecotamic / sitemap

Sitemap for Statamic v3
6 stars 9 forks source link

Is it good practice to list all multisite entries in the same file? #9

Closed stuartcusackie closed 3 years ago

stuartcusackie commented 3 years ago

Hi, great package! Saved me a lot of work.

I just noticed the sitemap.xml contains all multisite entries, regardless of what domain I am currently viewing. I would have thought that each domain's sitemap.xml would only list the localised entries for that domain.

It might be fine but I'm just wondering if this is good practice and will it cause problems for webmaster tools?

werner-freytag commented 3 years ago

I did some quick research and apparently a sitemap is actually supposed to have only the URLs of a single domain. So I will correct that in an update.

stuartcusackie commented 3 years ago

Thanks for checking!

By the way I had some of this done in a custom sitemap. These lines might save you a few seconds:

use Statamic\Facades\Site;

// When grabbing collections:
->where('locale', Site::current()->handle())
werner-freytag commented 3 years ago

Thanks! 🙂

By the way: You can also define a filter in the config/pecotamic/sitemap.php file - if you haven't already done so!

werner-freytag commented 3 years ago

Added fix in new release 1.2.3