Fix logoExists function to resolve web paths correctly and update stylesheet link to use absolute path

This commit is contained in:
Fabian Schieder 2026-02-28 01:36:12 +01:00
parent 2dcdf6e71c
commit 41c466733c

View File

@ -61,7 +61,7 @@ $projects = [
*/ */
function logoExists(string $webPath): bool { function logoExists(string $webPath): bool {
$base = rtrim($_SERVER['DOCUMENT_ROOT'] ?? '/var/www/fabianschieder.com', '/'); $base = rtrim($_SERVER['DOCUMENT_ROOT'] ?? '/var/www/fabianschieder.com', '/');
$full = $base . '/' . ltrim($webPath, '/'); $full = $base . ltrim($webPath, '.');
// Debug: echo "<!-- checking: $full -->\n"; // Debug: echo "<!-- checking: $full -->\n";
return is_file($full); return is_file($full);
} }
@ -73,7 +73,7 @@ function logoExists(string $webPath): bool {
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fabian Schieder</title> <title>Fabian Schieder</title>
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
</head> </head>
<body> <body>