]> BookStack Code Mirror - bookstack/commitdiff
Move Manifest Definition to Separate Config File
authorJonatanRek <redacted>
Thu, 10 Aug 2023 15:02:31 +0000 (17:02 +0200)
committerJonatanRek <redacted>
Thu, 10 Aug 2023 15:02:31 +0000 (17:02 +0200)
app/App/HomeController.php
app/Config/manifest.php [new file with mode: 0644]

index 641b84fa8b8f6133bf6ce852d80547f079f8a487..d971247df738fecda62d3ef862a3b833bcd48106 100644 (file)
@@ -147,61 +147,10 @@ class HomeController extends Controller
     */
     public function manifest()
     {   
-        $manifest = [
-            "name" => (config('app.name' | 'BookStack') ??'BookStack' ), 
-            "short_name" => "bookstack", 
-            "start_url" => "./", 
-            "scope" => ".", 
-            "display" => "standalone", 
-            "background_color" => setting('app-color'), 
-            "description" =>( config('app.name' | 'BookStack') ??'BookStack'), 
-            "categories" => [
-                "productivity", 
-                "lifestyle" 
-            ], 
-            "launch_handler" => [
-                "client_mode" => "focus-existing" 
-            ], 
-            "orientation" => "portrait", 
-            "icons" => [
-                [
-                    "src" => "/icon-64.png", 
-                    "sizes" => "64x64", 
-                    "type" => "image/png" 
-                ], 
-                [
-                    "src" => "/icon-32.png", 
-                    "sizes" => "32x32", 
-                    "type" => "image/png" 
-                ], 
-                [
-                    "src" => "/icon-128.png", 
-                    "sizes" => "128x128", 
-                    "type" => "image/png" 
-                ], 
-                [
-                    "src" => "icon-180.png", 
-                    "sizes" => "180x180", 
-                    "type" => "image/png" 
-                ], 
-                [
-                    "src" => "icon.png", 
-                    "sizes" => "256x256", 
-                    "type" => "image/png" 
-                ], 
-                [
-                    "src" => "icon.ico", 
-                    "sizes" => "48x48", 
-                    "type" => "image/vnd.microsoft.icon" 
-                ], 
-                [
-                    "src" => "favicon.ico", 
-                    "sizes" => "48x48", 
-                    "type" => "image/vnd.microsoft.icon" 
-                ],
-            ],
-        ]; 
+        $manifest =  config('manifest');
         
+        $manifest["background_color"] = setting('app-color');
+
         return response()->json($manifest);
     }
 }
diff --git a/app/Config/manifest.php b/app/Config/manifest.php
new file mode 100644 (file)
index 0000000..640ba70
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+return [
+    "name" => (env('APP_NAME' | 'BookStack') ??'BookStack' ), 
+    "short_name" => "bookstack", 
+    "start_url" => "./", 
+    "scope" => ".", 
+    "display" => "standalone", 
+    "background_color" => "#fff", 
+    "description" =>( env('APP_NAME' | 'BookStack') ??'BookStack'), 
+    "categories" => [
+        "productivity", 
+        "lifestyle" 
+    ], 
+    "launch_handler" => [
+        "client_mode" => "focus-existing" 
+    ], 
+    "orientation" => "portrait", 
+    "icons" => [
+        [
+            "src" => "/icon-64.png", 
+            "sizes" => "64x64", 
+            "type" => "image/png" 
+        ], 
+        [
+            "src" => "/icon-32.png", 
+            "sizes" => "32x32", 
+            "type" => "image/png" 
+        ], 
+        [
+            "src" => "/icon-128.png", 
+            "sizes" => "128x128", 
+            "type" => "image/png" 
+        ], 
+        [
+            "src" => "icon-180.png", 
+            "sizes" => "180x180", 
+            "type" => "image/png" 
+        ], 
+        [
+            "src" => "icon.png", 
+            "sizes" => "256x256", 
+            "type" => "image/png" 
+        ], 
+        [
+            "src" => "icon.ico", 
+            "sizes" => "48x48", 
+            "type" => "image/vnd.microsoft.icon" 
+        ], 
+        [
+            "src" => "favicon.ico", 
+            "sizes" => "48x48", 
+            "type" => "image/vnd.microsoft.icon" 
+        ],
+    ],
+];
\ No newline at end of file