feat: page profil public /profil/{slug} avec liste des articles

This commit is contained in:
Cedric Abonnel
2026-05-12 23:49:21 +02:00
parent e1c179b536
commit 654542f13b
7 changed files with 195 additions and 8 deletions
+6 -1
View File
@@ -46,6 +46,7 @@ $externalLinks = $article['external_links'] ?? [];
$authorEmail = $article['author'] ?? '';
$authorName = ($authorEmail !== '' && function_exists('authorDisplayName')) ? authorDisplayName($authorEmail) : '';
$authorProfileUrl = ($authorEmail !== '' && function_exists('authorProfileUrl')) ? authorProfileUrl($authorEmail) : '';
$authorSlugVal = ($authorEmail !== '' && function_exists('authorSlug')) ? authorSlug($authorEmail) : '';
$pubDate = htmlspecialchars(date('d/m/Y', strtotime((string)($article['published_at'] ?? $article['created_at'] ?? ''))));
$hasCover = $coverFile !== '';
$heroExtraClass = $hasCover ? '' : ' article-cover--gradient';
@@ -80,7 +81,11 @@ $hasSources = (!empty($externalLinks) || !empty($files))
<h1 class="article-title"><?= htmlspecialchars($article['title']) ?></h1>
<p class="article-hero-meta">
<?php if ($authorName !== ''): ?>
<span><?= htmlspecialchars($authorName) ?></span>
<?php if ($authorSlugVal !== ''): ?>
<a href="/profil/<?= rawurlencode($authorSlugVal) ?>" class="text-reset"><?= htmlspecialchars($authorName) ?></a>
<?php else: ?>
<span><?= htmlspecialchars($authorName) ?></span>
<?php endif; ?>
<span class="mx-1 opacity-50">·</span>
<?php endif; ?>
<?= $pubDate ?>