Version website stylesheet asset

This commit is contained in:
juvdiaz 2026-06-10 15:53:50 -06:00
parent a270c6eca4
commit f121910cba
6 changed files with 11 additions and 5 deletions

View File

@ -200,7 +200,7 @@ function renderStackSourceLinks(string $stackKey, array $sourceLinks, string $so
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title><?php echo $text['blog_title']; ?> - <?php echo $text['name']; ?></title> <title><?php echo $text['blog_title']; ?> - <?php echo $text['name']; ?></title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="<?php echo asset_url('styles.css'); ?>">
</head> </head>
<body class="theme-dark"> <body class="theme-dark">

View File

@ -38,7 +38,7 @@ $recruiterKeys = [
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>CV - <?php echo $text['name']; ?></title> <title>CV - <?php echo $text['name']; ?></title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="<?php echo asset_url('styles.css'); ?>">
</head> </head>
<body class="cv-page theme-dark"> <body class="cv-page theme-dark">

View File

@ -72,7 +72,7 @@ $demoCards = [
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title><?php echo $text['demos_title']; ?> - <?php echo $text['name']; ?></title> <title><?php echo $text['demos_title']; ?> - <?php echo $text['name']; ?></title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="<?php echo asset_url('styles.css'); ?>">
</head> </head>
<body class="theme-dark"> <body class="theme-dark">

View File

@ -8,7 +8,7 @@ $blogHref = 'blog.php?lang=' . urlencode($lang);
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title><?php echo $text['tree_title']; ?> - <?php echo $text['name']; ?></title> <title><?php echo $text['tree_title']; ?> - <?php echo $text['name']; ?></title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="<?php echo asset_url('styles.css'); ?>">
</head> </head>
<body> <body>

View File

@ -24,7 +24,7 @@ $homeProofCards = [
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title><?php echo $text['name']; ?></title> <title><?php echo $text['name']; ?></title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="<?php echo asset_url('styles.css'); ?>">
</head> </head>
<body class="home-page theme-dark"> <body class="home-page theme-dark">

View File

@ -56,6 +56,12 @@ function loadRuntimeTranslations(string $file, array $base): array {
return $translations; return $translations;
} }
function asset_url(string $path): string {
$fullPath = __DIR__ . '/' . ltrim($path, '/');
$version = is_file($fullPath) ? (string) filemtime($fullPath) : '1';
return htmlspecialchars($path . '?v=' . $version);
}
$lang = getLang($availableLangs); $lang = getLang($availableLangs);
$en = include "$staticLangDir/en.php"; $en = include "$staticLangDir/en.php";