| 1 | diff --git a/internal/webui/manifest.webmanifest b/internal/webui/manifest.webmanifest |
| 2 | index 36d884c..709759c 100644 |
| 3 | --- a/internal/webui/manifest.webmanifest |
| 4 | +++ b/internal/webui/manifest.webmanifest |
| 5 | @@ -26,6 +26,10 @@ |
| 6 | {"src": "BASE/icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any"}, |
| 7 | {"src": "BASE/icon-mono.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "monochrome"} |
| 8 | ], |
| 9 | + "screenshots": [ |
| 10 | + {"src": "BASE/screenshot-narrow.png", "sizes": "390x844", "type": "image/png", "form_factor": "narrow", "label": "Files on a phone"}, |
| 11 | + {"src": "BASE/screenshot-wide.png", "sizes": "1280x800", "type": "image/png", "form_factor": "wide", "label": "Repositories on a desktop"} |
| 12 | + ], |
| 13 | "shortcuts": [ |
| 14 | {"name": "Files", "url": "BASE/files", "icons": [{"src": "BASE/icon-192.png", "sizes": "192x192"}]}, |
| 15 | {"name": "Repositories", "url": "BASE/repos", "icons": [{"src": "BASE/icon-192.png", "sizes": "192x192"}]}, |
| 16 | diff --git a/internal/webui/screenshot-narrow.png b/internal/webui/screenshot-narrow.png |
| 17 | index 78821be..1f76642 100644 |
| 18 | Binary files a/internal/webui/screenshot-narrow.png and b/internal/webui/screenshot-narrow.png differ |
| 19 | diff --git a/internal/webui/templates.go b/internal/webui/templates.go |
| 20 | index 1401d56..e07e6cb 100644 |
| 21 | --- a/internal/webui/templates.go |
| 22 | +++ b/internal/webui/templates.go |
| 23 | @@ -77,6 +77,12 @@ var appleTouchIconPNG []byte |
| 24 | //go:embed badge-96.png |
| 25 | var badgePNG []byte |
| 26 | |
| 27 | +//go:embed screenshot-narrow.png |
| 28 | +var screenshotNarrowPNG []byte |
| 29 | + |
| 30 | +//go:embed screenshot-wide.png |
| 31 | +var screenshotWidePNG []byte |
| 32 | + |
| 33 | //go:embed sw.js |
| 34 | var serviceWorkerJS []byte |
| 35 | |
| 36 | diff --git a/internal/webui/webui.go b/internal/webui/webui.go |
| 37 | index f751837..ac7cc56 100644 |
| 38 | --- a/internal/webui/webui.go |
| 39 | +++ b/internal/webui/webui.go |
| 40 | @@ -220,7 +220,7 @@ func (a *App) ServeHTTP(writer http.ResponseWriter, request *http.Request) { |
| 41 | _, _ = writer.Write(serviceWorkerJS) |
| 42 | return |
| 43 | } |
| 44 | - if png, ok := map[string][]byte{"/icon-192.png": icon192PNG, "/icon-512.png": icon512PNG, "/icon-maskable-512.png": iconMaskablePNG, "/apple-touch-icon.png": appleTouchIconPNG, "/badge-96.png": badgePNG}[request.URL.Path]; ok { |
| 45 | + if png, ok := map[string][]byte{"/icon-192.png": icon192PNG, "/icon-512.png": icon512PNG, "/icon-maskable-512.png": iconMaskablePNG, "/apple-touch-icon.png": appleTouchIconPNG, "/badge-96.png": badgePNG, "/screenshot-narrow.png": screenshotNarrowPNG, "/screenshot-wide.png": screenshotWidePNG}[request.URL.Path]; ok { |
| 46 | writer.Header().Set("content-type", "image/png") |
| 47 | writer.Header().Set("cache-control", "public, max-age=86400") |
| 48 | _, _ = writer.Write(png) |