feat : page /books et section livres accueil (v1.6.26)

- #99 : page publique /books — catalogue des books avec ≥1 article publié
- #100 : section « Livres » sur la homepage (max 6, après redécouvertes)
- CSS : .book-grid, .book-home-card*, .home-section-more
- .htaccess : règle RewriteRule ^books/?$

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 16:53:23 +02:00
parent 84d4b12fb2
commit c140ba4069
7 changed files with 190 additions and 1 deletions
+32
View File
@@ -214,6 +214,38 @@ function _renderCard(array $post, array $privateCats, array $allCats, \Parsedown
</section>
<?php endif; ?>
<?php if (!empty($homeBooks ?? [])): ?>
<section class="home-section">
<h2 class="home-section-title">
Livres
<a href="/books" class="home-section-more">Voir tous →</a>
</h2>
<div class="book-grid">
<?php foreach ($homeBooks as $_hb):
$_book = $_hb['book'];
$_first = $_hb['first'];
$_count = $_hb['count'];
$_cover = $_first['cover'] ?? '';
$_cat = trim($_first['category'] ?? '');
$_coverStyle = $_cover !== ''
? "background-image:url('/file?uuid=" . rawurlencode($_first['uuid']) . "&name=" . rawurlencode($_cover) . "')"
: 'background:' . coverGradient($_cat !== '' ? $_cat : $_first['uuid'], $allCats ?? []);
?>
<a href="/book/<?= rawurlencode($_book['slug']) ?>" class="book-home-card">
<div class="book-home-card-cover" style="<?= $_coverStyle ?>"></div>
<div class="book-home-card-body">
<div class="book-home-card-title"><?= htmlspecialchars($_book['title']) ?></div>
<?php if (!empty($_book['description'])): ?>
<div class="book-home-card-desc"><?= htmlspecialchars(mb_strimwidth($_book['description'], 0, 80, '…')) ?></div>
<?php endif; ?>
<div class="book-home-card-meta"><?= $_count ?> page<?= $_count > 1 ? 's' : '' ?></div>
</div>
</a>
<?php endforeach; ?>
</div>
</section>
<?php endif; ?>
<?php else: /* ─── VUE PAGINÉE / FILTRÉE ─────────────────────────────── */ ?>
<?php if ($cursor === '' && $filterCat === ''): ?>