Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 8c188f5

Browse files
authored
prevent manifest routes from having double handles (#12)
1 parent 13de3ba commit 8c188f5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

routes/web.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
use Illuminate\Support\Facades\Route;
44
use Statamic\Facades\Site;
55
use Statamic\Facades\URL;
6+
use Stringy\StaticStringy as Stringy;
67

78
Site::all()->each(function (\Statamic\Sites\Site $site) {
89
$relativeSiteUrl = URL::makeRelative($site->url());
910

1011
// The Manifest route to the manifest.json
11-
$manifest = Site::all()->count() === 1
12-
? 'site.webmanifest'
13-
: $site->handle() . '/site.webmanifest';
12+
$manifestUrl = Site::all()->count() === 1
13+
? $relativeSiteUrl . '/site.webmanifest'
14+
: Stringy::ensureRight($relativeSiteUrl, '/' . $site->handle()) . '/site.webmanifest';
1415

15-
Route::statamic(URL::tidy($relativeSiteUrl . '/' . $manifest), 'statamic-peak-browser-appearance::manifest/manifest', [
16+
Route::statamic(URL::tidy($manifestUrl), 'statamic-peak-browser-appearance::manifest/manifest', [
1617
'layout' => null,
1718
'content_type' => 'application/json'
1819
])->name('manifest.' . $site->handle());

0 commit comments

Comments
 (0)