Add runtime asset and layout diagnostics to index.php and implement asset versioning in head.php
This commit is contained in:
+6
-2
@@ -1,6 +1,10 @@
|
||||
<?php
|
||||
$pageTitle = $pageTitle ?? 'FlixCooks | Food Blog & Recipes';
|
||||
$description = $description ?? 'Seasonal recipes, tested tips, and approachable cooking for busy weeknights.';
|
||||
$assetVersion = static function (string $assetPath): string {
|
||||
$absolutePath = dirname(__DIR__) . '/' . ltrim($assetPath, '/');
|
||||
return is_file($absolutePath) ? (string) filemtime($absolutePath) : '1';
|
||||
};
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -18,8 +22,8 @@ $description = $description ?? 'Seasonal recipes, tested tips, and approachable
|
||||
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Manrope:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Main stylesheet -->
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
<script src="/assets/fc-local.js" defer></script>
|
||||
<link rel="stylesheet" href="/assets/style.css?v=<?php echo e($assetVersion('/assets/style.css')); ?>">
|
||||
<script src="/assets/fc-local.js?v=<?php echo e($assetVersion('/assets/fc-local.js')); ?>" defer></script>
|
||||
|
||||
<!-- GSAP + ScrollTrigger (CDN) -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user