From 2e08aa2573e1624cf17b880bada6b0f3cd03207c Mon Sep 17 00:00:00 2001 From: 778a69cd <778a69cd@potsda.mn> Date: Thu, 10 Aug 2023 21:50:45 +0200 Subject: [PATCH] reintroduce webmanifest for PWA compatability --- js/vite.config.js | 30 ++++++++++++++++++++++++++ lib/web/mobilizon_web.ex | 2 +- lib/web/templates/page/index.html.heex | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/js/vite.config.js b/js/vite.config.js index 184f0ac91..e56efeef8 100644 --- a/js/vite.config.js +++ b/js/vite.config.js @@ -23,10 +23,40 @@ export default defineConfig(({ command }) => { strategies: "injectManifest", srcDir: "src", filename: "service-worker.ts", + theme_color: "#ffd599", // injectRegister: "auto", // devOptions: { // enabled: true, // }, + manifest: { + name: "Mobilizon", + short_name: "Mobilizon", + orientation: "portrait-primary", + icons: [ + { + src: "./img/icons/android-chrome-192x192.png", + sizes: "192x192", + type: "image/png", + }, + { + src: "./img/icons/android-chrome-512x512.png", + sizes: "512x512", + type: "image/png", + }, + { + src: "./img/icons/android-chrome-maskable-192x192.png", + sizes: "192x192", + type: "image/png", + purpose: "maskable", + }, + { + src: "./img/icons/android-chrome-maskable-512x512.png", + sizes: "512x512", + type: "image/png", + purpose: "maskable", + }, + ], + }, }), visualizer(), ], diff --git a/lib/web/mobilizon_web.ex b/lib/web/mobilizon_web.ex index 2c955e952..a1f97a6e3 100644 --- a/lib/web/mobilizon_web.ex +++ b/lib/web/mobilizon_web.ex @@ -19,7 +19,7 @@ defmodule Mobilizon.Web do def static_paths, do: - ~w(index.html manifest.json service-worker.js css fonts img js favicon.ico robots.txt assets) + ~w(index.html manifest.json manifest.webmanifest service-worker.js css fonts img js favicon.ico robots.txt assets) def controller do quote do diff --git a/lib/web/templates/page/index.html.heex b/lib/web/templates/page/index.html.heex index 7047727cb..f3764f3ec 100644 --- a/lib/web/templates/page/index.html.heex +++ b/lib/web/templates/page/index.html.heex @@ -6,6 +6,7 @@ +