fix(pages): make page URLs and assets base-aware

Root-absolute asset paths and ?p= links broke when the site is
served from a subfolder (WAMP). Screenshots from the database and
avatars from creators.json go through fws_url() as well.
This commit is contained in:
BlackAngelTV committed 2026-09-16 14:35:33 +02:00
1 parent da74767843
commit ae472fe30a
7 files changed
+25 -25

No files matched your search

+3 -3
View File
@@ -14,8 +14,8 @@ if (!defined('FWS_PAGE_SHELL')) {
$title = "L'équipe | FWS Linux";
$description = 'Découvrez les contributeurs de FWS Linux — l\'équipe qui développe et maintient cette distribution open-source.';
$extraCss[] = '/p/assets/styles/equipe.css';
$extraCss[] = '/p/assets/styles/creators.css';
$extraCss[] = fws_url('/p/assets/styles/equipe.css');
$extraCss[] = fws_url('/p/assets/styles/creators.css');
$creators = [];
$file = dirname(__DIR__) . '/equipe/creators.json';
@@ -39,7 +39,7 @@ if (is_file($file)) {
<?php foreach ($creators as $creator): ?>
<article class="creator-card">
<?php if (!empty($creator['avatar'])): ?>
<img class="creator-avatar" src="<?= e((string) $creator['avatar']) ?>" alt="<?= e((string) ($creator['name'] ?? $creator['role'] ?? '')) ?>" loading="lazy">
<img class="creator-avatar" src="<?= e(fws_url((string) $creator['avatar'])) ?>" alt="<?= e((string) ($creator['name'] ?? $creator['role'] ?? '')) ?>" loading="lazy">
<?php endif; ?>
<div class="creator-info">
<?php if (!empty($creator['name'])): ?>