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

Commit 27cc26a

Browse files
authored
register site.webmanifest routes with site specific url (#10)
1 parent 2b9a37b commit 27cc26a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

routes/web.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
use Statamic\Facades\Site;
55
use Statamic\Facades\URL;
66

7-
Site::all()->each(function (\Statamic\Sites\Site $site) {
7+
$sitesCount = Site::all()->count();
8+
9+
Site::all()->each(function (\Statamic\Sites\Site $site) use ($sitesCount) {
810
$relativeSiteUrl = URL::makeRelative($site->url());
911

1012
// The Manifest route to the manifest.json
11-
Route::statamic(URL::tidy($relativeSiteUrl . '/site.webmanifest'), 'statamic-peak-browser-appearance::manifest/manifest', [
13+
$manifest = $sitesCount === 1 ? 'site.webmanifest' : $site->handle() . '/site.webmanifest';
14+
Route::statamic(URL::tidy($relativeSiteUrl . '/' . $manifest), 'statamic-peak-browser-appearance::manifest/manifest', [
1215
'layout' => null,
1316
'content_type' => 'application/json'
1417
])->name('manifest.' . $site->handle());

0 commit comments

Comments
 (0)