1
0
mirror of https://koodu.h-i.works/projects/thebadspace synced 2025-05-06 14:41:02 -05:00

feat: read version number from composer.json

this enables any cached css files to automatically to be discarded on release of a new version.

Signed-off-by: Zoë Bijl <hiworks@hello.moiety.me>
Signed-off-by: Zoë <hiworks@hello.moiety.me>
Signed-off-by: Zoë <code@moiety.me>
This commit is contained in:
Zoë 2025-05-01 23:29:25 +02:00
parent c86b1b687b
commit dc352478b5

View File

@ -1,3 +1,11 @@
<?php
// Get and decode composer.json
$content = file_get_contents(__DIR__ . '/../../../composer.json');
$content = json_decode($content, true);
// Get the version number
$version = $content['version'];
?>
<!DOCTYPE html>
<html>
@ -6,12 +14,12 @@
<meta name="theme-color" content="#c3639e" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
@yield('title')
@yield('title')
</title>
@if(isset($front) && $front == false)
<link rel="stylesheet" type="text/css" href="/assets/css/back/start.css?=sdfsdf">
@elseif(!isset($front) || $front == true)
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?=sdfsdf">
<link rel="stylesheet" type="text/css" href="/assets/css/back/start.css?v=<?php echo($version); ?>">
@elseif(!isset($front) || $front == true)
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?v=<?php echo($version); ?>">
@endif
</head>
@ -100,4 +108,4 @@
</body>
</body>
</html>
</html>