]> BookStack Code Mirror - bookstack/commitdiff
Added view override support
authorDan Brown <redacted>
Sun, 31 Dec 2017 16:25:58 +0000 (16:25 +0000)
committerDan Brown <redacted>
Sun, 31 Dec 2017 16:25:58 +0000 (16:25 +0000)
Relates to #652

config/view.php
themes/.gitignore [new file with mode: 0755]

index e193ab61d910e0ce50230fc4616c5f9d9c9cdc33..8dc2841e748f035bd4860081ab6dfb760c922e53 100644 (file)
@@ -1,5 +1,10 @@
 <?php
 
+$viewPaths = [realpath(base_path('resources/views'))];
+if ($theme = env('APP_THEME', false)) {
+    array_unshift($viewPaths, base_path('themes/' . $theme));
+}
+
 return [
 
     /*
@@ -13,9 +18,7 @@ return [
     |
     */
 
-    'paths' => [
-        realpath(base_path('resources/views')),
-    ],
+    'paths' => $viewPaths,
 
     /*
     |--------------------------------------------------------------------------
diff --git a/themes/.gitignore b/themes/.gitignore
new file mode 100755 (executable)
index 0000000..d6b7ef3
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!.gitignore