1
0

add cache buster

This commit is contained in:
Philip Wagner
2025-03-26 13:23:40 +01:00
parent 4e6b1d6a11
commit facfdcf97d
2 changed files with 11 additions and 2 deletions

View File

@@ -31,4 +31,13 @@ function randomBg(): string {
static $colors = ["#f1edeb", "#ff00ff", "#48bd8d", "#8200ff", "#ff6700"];
$a = array_rand($colors, 2);
return bg($colors[$a[0]], $colors[$a[1]]);
}
}
Kirby::plugin('cache/buster', [
'components' => [
'css' => function ($kirby, $url, $options) {
$hash = md5_file($url);
return "$url?$hash";
}
]
]);

View File

@@ -8,7 +8,7 @@
@font-face { font-family: 'Kobata'; src: url('<?= url('assets/Kobata-Bold.woff2') ?>') format('woff2') }
@font-face { font-family: 'VG5000'; src: url('<?= url('assets/VG5000-Regular_web.woff2') ?>') format('woff2') }
</style>
<link rel="stylesheet" type="text/css" href="<?= url('assets/style.css') ?>">
<?= css('assets/style.css') ?>
</head>
<body>