Skip to content

Commit

Permalink
Update PublicController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Feb 26, 2021
1 parent 44e5106 commit bdacca2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Http/Controllers/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use TypiCMS\Modules\Core\Facades\TypiCMS;
use TypiCMS\Modules\Pages\Models\Page;

Expand Down Expand Up @@ -39,6 +41,10 @@ public function generate(): Response
continue;
}

if (!Route::has($locale.'::'.Str::singular(mb_strtolower($module)))) {
continue;
}

foreach ($module::published()->get() as $item) {
$url = url($item->uri($locale));
$sitemap->add($url, $item->updated_at);
Expand Down

0 comments on commit bdacca2

Please sign in to comment.