summaryrefslogtreecommitdiff
path: root/common.php
diff options
context:
space:
mode:
authorJonas Kohl <gitlab@jonaskohl.de>2024-07-26 10:20:45 +0200
committerJonas Kohl <gitlab@jonaskohl.de>2024-07-26 10:20:45 +0200
commitc93880a266edaac4703a3f7be4047f404cff9c00 (patch)
tree6e3793375e8b40269dccd1810dfa86a304de4095 /common.php
parent24af4c37a4b022907974f5b9dbfd975a7897eb56 (diff)
Add versions to assets
Diffstat (limited to 'common.php')
-rw-r--r--common.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/common.php b/common.php
index cba823a..d1cd758 100644
--- a/common.php
+++ b/common.php
@@ -2,6 +2,13 @@
define("SRCDIR", realpath(__DIR__ . "/src/"));
+function assetver(string $path): string {
+ $path = SRCDIR . "/" . $path;
+ if (!is_file($path))
+ return "0";
+ return md5_file($path);
+}
+
function hzcom_expand(string $pageContents): string {
$params = [];
$page = SRCDIR . "/pages/" . bin2hex(random_bytes(8)) . ".tmp";