From 057a2b1ce59ad135e48df33c22bf05ae6b7c1342 Mon Sep 17 00:00:00 2001 From: afterlifepro Date: Fri, 3 Oct 2025 16:06:59 +0100 Subject: [PATCH] appview/state, nix/pkgs, /: generate png icons and add to pwa manifest this is required since firefox apparently doesn't support png icons (in my testing) Signed-off-by: afterlifepro --- .../pages/templates/fragments/dolly/logo.svg | 45 +++++++++++++++++++ appview/state/state.go | 33 +++++++++++++- nix/pkgs/appview-static-files.nix | 9 ++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 appview/pages/templates/fragments/dolly/logo.svg diff --git a/appview/pages/templates/fragments/dolly/logo.svg b/appview/pages/templates/fragments/dolly/logo.svg new file mode 100644 index 00000000..09b26f1c --- /dev/null +++ b/appview/pages/templates/fragments/dolly/logo.svg @@ -0,0 +1,45 @@ + + Dolly + + + + + + + + \ No newline at end of file diff --git a/appview/state/state.go b/appview/state/state.go index ae911092..50058090 100644 --- a/appview/state/state.go +++ b/appview/state/state.go @@ -220,12 +220,43 @@ const manifestJson = `{ "icons": [ { "src": "/favicon.svg", + "type": "image/xml+svg", + "sizes": "any", + "purpose": "any" + }, + { + "src": "/static/pwa-512.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "/static/pwa-192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/static/pwa-144.png", + "type": "image/png", "sizes": "144x144" + }, + { + "src": "/static/pwa-96.png", + "type": "image/png", + "sizes": "96x96" + }, + { + "src": "/static/pwa-72.png", + "type": "image/png", + "sizes": "72x72" + }, + { + "src": "/static/pwa-48.png", + "type": "image/png", + "sizes": "48x48" } ], "start_url": "/", "id": "org.tangled", - "display": "standalone", "background_color": "#111827", "theme_color": "#111827" diff --git a/nix/pkgs/appview-static-files.nix b/nix/pkgs/appview-static-files.nix index 72c8c674..36bd5503 100644 --- a/nix/pkgs/appview-static-files.nix +++ b/nix/pkgs/appview-static-files.nix @@ -7,6 +7,7 @@ ibm-plex-mono-src, sqlite-lib, tailwindcss, + imagemagick, src, }: runCommandLocal "appview-static-files" { @@ -16,6 +17,7 @@ runCommandLocal "appview-static-files" { (allow file-read* (subpath "/System/Library/OpenSSL")) ''; } '' + #!/bin/bash mkdir -p $out/{fonts,icons} && cd $out cp -f ${htmx-src} htmx.min.js cp -f ${htmx-ws-src} htmx-ext-ws.min.js @@ -24,6 +26,13 @@ runCommandLocal "appview-static-files" { cp -f ${inter-fonts-src}/web/InterDisplay*.woff2 fonts/ cp -f ${inter-fonts-src}/InterVariable*.ttf fonts/ cp -f ${ibm-plex-mono-src}/fonts/complete/woff2/IBMPlexMono*.woff2 fonts/ + sizes=(48 72 96 144 162 512) + for size in "''${sizes[@]}"; do + ${imagemagick}/bin/magick -density 3000 -background none \ + ${src}/appview/pages/templates/fragments/dolly/logo.svg \ + -resize ''${size}x''${size} \ + $out/pwa-''${size}.png + done # tailwindcss -c $src/tailwind.config.js -i $src/input.css -o tw.css won't work # for whatever reason (produces broken css), so we are doing this instead cd ${src} && ${tailwindcss}/bin/tailwindcss -i input.css -o $out/tw.css -- 2.51.0