Ver código fonte

feat: add installable PWA metadata

Stefan Stidl 1 semana atrás
pai
commit
3b25d9e33a

+ 2 - 0
Dockerfile

@@ -27,6 +27,8 @@ COPY index-modern.html /speedtest/
 COPY config.json /speedtest/
 COPY stability.html /speedtest/
 COPY favicon.ico /speedtest/
+COPY manifest.webmanifest /speedtest/
+COPY images/ /speedtest/images/
 
 COPY docker/entrypoint.sh /
 

+ 2 - 0
Dockerfile.alpine

@@ -37,6 +37,8 @@ COPY index-modern.html /speedtest/
 COPY config.json /speedtest/
 COPY stability.html /speedtest/
 COPY favicon.ico /speedtest/
+COPY manifest.webmanifest /speedtest/
+COPY images/ /speedtest/images/
 
 COPY docker/entrypoint.sh /
 

+ 3 - 1
docker/entrypoint.sh

@@ -41,8 +41,10 @@ cp /speedtest/stability.html /var/www/html/
 cp /speedtest/config.json /var/www/html/
 cp /speedtest/design-switch.js /var/www/html/
 
-# Copy favicon
+# Copy PWA metadata and icons
 cp /speedtest/favicon.ico /var/www/html/
+cp /speedtest/manifest.webmanifest /var/www/html/
+cp -r /speedtest/images /var/www/html/
 
 # Set custom webroot on alpine
 if is_alpine; then

BIN
images/icon-192.png


BIN
images/icon-512.png


+ 3 - 0
index-classic.html

@@ -3,6 +3,9 @@
 
 <head>
 	<link rel="shortcut icon" href="favicon.ico">
+	<link rel="manifest" href="manifest.webmanifest">
+	<link rel="apple-touch-icon" href="images/icon-192.png">
+	<meta name="theme-color" content="#000000">
 	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no" />
 	<meta charset="UTF-8" />
 	<script type="text/javascript" src="speedtest.js"></script>

+ 3 - 0
index-modern.html

@@ -7,6 +7,9 @@
   <meta name="description"
     content="Free and Open Source Speedtest. Run it right now in your browser, or self-host on a PHP, Golang, Rust or Node server. License: LGPL." />
   <link rel="shortcut icon" href="images/favicon.svg" />
+  <link rel="manifest" href="manifest.webmanifest" />
+  <link rel="apple-touch-icon" href="images/icon-192.png" />
+  <meta name="theme-color" content="#000000" />
   <script type="text/javascript" src="speedtest.js"></script>
   <script type="text/javascript">
     // Set this to a different URL to load the server list from another location.

+ 3 - 0
index.html

@@ -3,6 +3,9 @@
 
 <head>
     <link rel="shortcut icon" href="favicon.ico">
+    <link rel="manifest" href="manifest.webmanifest">
+    <link rel="apple-touch-icon" href="images/icon-192.png">
+    <meta name="theme-color" content="#000000">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no" />
     <meta charset="UTF-8" />
     <script type="text/javascript" src="design-switch.js"></script>

+ 20 - 0
manifest.webmanifest

@@ -0,0 +1,20 @@
+{
+  "name": "LibreSpeed",
+  "short_name": "LibreSpeed",
+  "start_url": "./",
+  "display": "standalone",
+  "background_color": "#000000",
+  "theme_color": "#000000",
+  "icons": [
+    {
+      "src": "images/icon-192.png",
+      "sizes": "192x192",
+      "type": "image/png"
+    },
+    {
+      "src": "images/icon-512.png",
+      "sizes": "512x512",
+      "type": "image/png"
+    }
+  ]
+}