feat: images de couverture (liste, vue article, og:image)

This commit is contained in:
Cedric Abonnel
2026-05-08 23:04:05 +02:00
parent 35503e43b0
commit 8703a5544f
4 changed files with 41 additions and 1 deletions
+12
View File
@@ -7,10 +7,22 @@ ob_start();
<a href="/" class="btn btn-secondary mb-3">← Retour</a>
<?php
$coverFile = $article['cover'] ?? '';
$ogImage = $coverFile !== ''
? url('file?uuid=' . rawurlencode($article['uuid']) . '&name=' . rawurlencode($coverFile))
: null;
?>
<div class="card mb-4">
<?php if (!$article['published']): ?>
<div class="draft-ribbon">Brouillon</div>
<?php endif; ?>
<?php if ($coverFile !== ''): ?>
<div class="article-cover">
<img src="/file?uuid=<?= rawurlencode($article['uuid']) ?>&name=<?= rawurlencode($coverFile) ?>"
alt="<?= htmlspecialchars($article['title']) ?>">
</div>
<?php endif; ?>
<div class="card-body">
<h2 class="card-title"><?= htmlspecialchars($article['title']) ?></h2>