Skip to content

Commit

Permalink
Merge branch 'release/1.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
werner-freytag committed May 17, 2023
2 parents e660717 + cd56687 commit 45bf7cc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function entries(): array
}

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

// filter by config
if ($excludedUrls = config('pecotamic.sitemap.exclude_urls')) {
Expand Down Expand Up @@ -151,10 +151,11 @@ protected function publishedCollectionTerms()
});
}

protected static function siteFilter($currentSite): callable
protected static function siteFilter(\Statamic\Sites\Site $currentSite): callable
{
return static function ($entry) use ($currentSite) {
return $entry->locale() === $currentSite;
return static function (\Statamic\Entries\Entry $entry) use ($currentSite) {
return $entry->redirectUrl() === null
&& $entry->locale() === $currentSite->lang();
};
}

Expand Down

0 comments on commit 45bf7cc

Please sign in to comment.