Browse Source

Add configuration

Sunny 2 years ago
parent
commit
aceea90064
5 changed files with 27 additions and 10 deletions
  1. 6 2
      assets/style.css
  2. 6 0
      config/config.php
  3. 7 5
      elements/footer.php
  4. 7 2
      elements/header.php
  5. 1 1
      pages/index.php

+ 6 - 2
assets/style.css

@@ -6,10 +6,14 @@
 }
 
 body {
-  margin: initial;
   background: var(--background);
   color: var(--color);
   font-family: var(--font);
+
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  margin: initial;
 }
 
 .wrapper {
@@ -31,7 +35,7 @@ header {
 }
 
 main {
-  max-height: calc(100vh - 7em);
+  flex: 1;
   overflow: auto;
 }
 

+ 6 - 0
config/config.php

@@ -0,0 +1,6 @@
+<?php
+  $config = [
+    "title" => "Tent",
+    "text" => "© 2023-present, Sunny. Not affiliated with Bandcamp. Licensed under the Blue Oak Model License."
+  ];
+?>

+ 7 - 5
elements/footer.php

@@ -1,9 +1,11 @@
       </div>
     </main>
-    <footer>
-      <div class="wrapper">
-        <span>© 2023-present, Sunny.</span>
-      </div>
-    </footer>
+    <?php if (isset($config["text"])) { ?>
+      <footer>
+        <div class="wrapper">
+          <span><?= $config["text"] ?></span>
+        </div>
+      </footer>
+    <?php } ?>
   </body>
 </html>

+ 7 - 2
elements/header.php

@@ -1,8 +1,13 @@
 <?php
+  include "../config/config.php";
+
+  if (!isset($config["title"]))
+    $config["title"] = "Tent";
+
   if (isset($title)) {
-    $title = "Tent · " . $title;
+    $title = $config["title"] . " · " . $title;
   } else {
-    $title = "Tent";
+    $title = $config["title"];
   };
 ?>
 

+ 1 - 1
pages/index.php

@@ -8,7 +8,7 @@
   $url = $scheme . "://" . $host . str_replace("/index.php", "/", $uri);
 ?>
 
-<h1>Tent</h1>
+<h1><?= $config["title"] ?></h1>
 <p>
   Tent is a simple alternative front-end for Bandcamp.
   <br>