Browse Source

Show commit in footer

Sunny 2 years ago
parent
commit
47bb778a1a
1 changed files with 10 additions and 1 deletions
  1. 10 1
      config/config.php

+ 10 - 1
config/config.php

@@ -1,12 +1,21 @@
 <?php
+  $commit = trim(file_get_contents("../.git/refs/heads/main"));
+
+  $text = substr($commit, 0, 7);
+  $link = "https://codeberg.org/sun/Tent/commit/" . $commit;
+
   $config = [
     // The title of this instance, displayed throughout the front-end. Default: Tent.
     "title" => "Tent",
 
     // A line of text displayed in the footer. May contain HTML. No default.
-    "text" => "© 2023-present, Sunny. Not affiliated with Bandcamp. Open-source at <a href=\"https://codeberg.org/sun/Tent\">Codeberg</a>.",
+    "text" => "© 2023-present, Sunny. Not affiliated with Bandcamp. Running commit <a href=\"" . $link . "\">" . $text . "</a>.",
 
     // Contents of the identity cookie when logged in to Bandcamp. Allows access to higher quality audio files. No default.
     "identity" => null
   ];
+
+  unset($commit);
+  unset($text);
+  unset($link);
 ?>