From 96b7097b4e6ff8e22d91398e66e824fd0a92e2aa Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 30 Jun 2022 23:49:30 +0200 Subject: [PATCH] Added manifest and serviceworker for PWA support --- assets/static/js/manifest.json | 26 +++++++++++++++++++ assets/static/js/serviceworker.js | 1 + .../templates/layout/app.html.eex | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 assets/static/js/manifest.json create mode 100644 assets/static/js/serviceworker.js diff --git a/assets/static/js/manifest.json b/assets/static/js/manifest.json new file mode 100644 index 000000000000..8e6f28b9eb0a --- /dev/null +++ b/assets/static/js/manifest.json @@ -0,0 +1,26 @@ +{ + "name": "Plausible Analytics", + "short_name": "Plausible", + "start_url": "/", + "display": "standalone", + "orientation": "any", + "status_bar": "black", + "icons": [ + { + "src": "\/images\/icon\/plausible_logo_sm.png", + "type": "image\/png", + "sizes": "150x200", + "purpose": "any" + } + ], + "shortcuts": [ + { + "name": "Create", + "description": "Create", + "url": "\/create", + "icons": [ + [] + ] + } + ] +} \ No newline at end of file diff --git a/assets/static/js/serviceworker.js b/assets/static/js/serviceworker.js new file mode 100644 index 000000000000..3de857ff4f75 --- /dev/null +++ b/assets/static/js/serviceworker.js @@ -0,0 +1 @@ +self.addEventListener("fetch",(function(){})); \ No newline at end of file diff --git a/lib/plausible_web/templates/layout/app.html.eex b/lib/plausible_web/templates/layout/app.html.eex index af87952946b8..20e2d9a4a894 100644 --- a/lib/plausible_web/templates/layout/app.html.eex +++ b/lib/plausible_web/templates/layout/app.html.eex @@ -9,6 +9,8 @@ <%= assigns[:title] || "Plausible ยท Simple, privacy-friendly alternative to Google Analytics" %> "/> + "/> + <%= render("_tracking.html", assigns) %>