Skip to content

Commit 45bf7cc

Browse files
Merge branch 'release/1.4.3'
2 parents e660717 + cd56687 commit 45bf7cc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Generator.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function entries(): array
3636
}
3737

3838
// filter by current site
39-
$entries = $entries->filter(self::siteFilter(Site::current()->handle()));
39+
$entries = $entries->filter(self::siteFilter(Site::current()));
4040

4141
// filter by config
4242
if ($excludedUrls = config('pecotamic.sitemap.exclude_urls')) {
@@ -151,10 +151,11 @@ protected function publishedCollectionTerms()
151151
});
152152
}
153153

154-
protected static function siteFilter($currentSite): callable
154+
protected static function siteFilter(\Statamic\Sites\Site $currentSite): callable
155155
{
156-
return static function ($entry) use ($currentSite) {
157-
return $entry->locale() === $currentSite;
156+
return static function (\Statamic\Entries\Entry $entry) use ($currentSite) {
157+
return $entry->redirectUrl() === null
158+
&& $entry->locale() === $currentSite->lang();
158159
};
159160
}
160161

0 commit comments

Comments
 (0)