Skip to content

Commit

Permalink
Remove old site config
Browse files Browse the repository at this point in the history
  • Loading branch information
martyf committed May 10, 2024
1 parent cea40ea commit b69eeb4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Support/Sitemapamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ protected function loadGlobalTaxonomies(): \Illuminate\Support\Collection
}

// get the current site key based on the url
$site = 'default';
foreach (config('statamic.sites.sites') as $key => $props) {
if ($props['url'] == url('/')) {
$site = $key;
$site = Site::default();
foreach (Site::all() as $key => $props) {
if ($props->url() == url('/')) {
$site = $props;
break;
}
}
Expand Down Expand Up @@ -383,7 +383,7 @@ protected function loadGlobalTaxonomies(): \Illuminate\Support\Collection
// we want to include it. So just include it.
return true;
})
->map(function (\Statamic\Taxonomies\LocalizedTerm $term) {
->map(function (\Statamic\Taxonomies\LocalizedTerm $term) use ($site) {
// get the term mod date
$lastMod = $term->get('updated_at');

Expand All @@ -408,7 +408,8 @@ protected function loadGlobalTaxonomies(): \Illuminate\Support\Collection
}

// get the site URL, or the app URL if its "/"
$siteUrl = config('statamic.sites.sites.'.$term->locale().'.url');
//$siteUrl = config('statamic.sites.sites.'.$term->locale().'.url');
$siteUrl = $site->url();
if ($siteUrl == '/') {
$siteUrl = config('app.url');
}
Expand Down

0 comments on commit b69eeb4

Please sign in to comment.