/
mnt
/
www
/
animaux-de-jardin.fr
/
Upload File
HOME
<?php require __DIR__ . '/config.php'; require_once __DIR__ . '/parts/picture.php'; $cat_info = $categories[$category] ?? null; // Resolve avatar: photo-ID → /images/photo-ID-400.jpg, URL → as-is $_avatar_src = ''; if (!empty($article_meta['author_avatar'])) { $av = $article_meta['author_avatar']; $_avatar_src = (str_starts_with($av, 'http://') || str_starts_with($av, 'https://')) ? $av : '/images/' . $av . '-400.jpg'; } $active_category = $category; $page_title = $article_meta['meta_title'] ?? $article_meta['title']; $page_description = $article_meta['meta_description'] ?? $article_meta['intro'] ?? ''; include __DIR__ . '/parts/header.php'; ?> <div class="container"> <nav class="breadcrumb"> <a href="/"><?php echo $lang['home'] ?? 'Accueil'; ?></a> › <a href="/<?php echo $category; ?>/"><?php echo htmlspecialchars($cat_info['name']); ?></a> › <strong><?php echo htmlspecialchars($article_meta['title']); ?></strong> </nav> </div> <div class="container"> <?php if (!empty($article_meta['image'])): ?> <div class="article-hero"> <?php picture($article_meta['image'], $article_meta['title'], '100vw', '', 'eager'); ?> </div> <?php endif; ?> </div> <div class="article-container"> <span class="article-tag-single"><?php echo htmlspecialchars($cat_info['name']); ?></span> <h1 class="article-title"><?php echo htmlspecialchars($article_meta['title']); ?></h1> <div class="article-meta"> <div class="article-meta-author"> <?php if ($_avatar_src): ?> <img src="<?php echo htmlspecialchars($_avatar_src); ?>" alt="<?php echo htmlspecialchars($article_meta['author_name']); ?>" class="article-meta-avatar"> <?php else: ?> <?php $initials = implode('', array_map(function($w) { return mb_strtoupper(mb_substr($w, 0, 1)); }, array_slice(explode(' ', $article_meta['author_name']), 0, 2))); ?> <span class="article-meta-avatar avatar-initials"><?php echo $initials; ?></span> <?php endif; ?> <span><?php echo htmlspecialchars($article_meta['author_name']); ?></span> </div> <span><?php echo htmlspecialchars($article_meta['date']); ?></span> <span><?php echo htmlspecialchars($article_meta['read_time']); ?> <?php echo $lang['read_time'] ?? 'min de lecture'; ?></span> </div> <div class="article-intro"><?php echo htmlspecialchars($article_meta['intro']); ?></div> <div class="article-content"><?php echo $content; ?></div> <?php if (!empty($article_meta['tags'])): ?> <div class="article-tags"> <?php foreach ($article_meta['tags'] as $tag): ?> <span><?php echo htmlspecialchars($tag); ?></span> <?php endforeach; ?> </div> <?php endif; ?> <div class="author-box"> <?php if ($_avatar_src): ?> <img src="<?php echo htmlspecialchars($_avatar_src); ?>" alt="<?php echo htmlspecialchars($article_meta['author_name']); ?>" class="author-box-avatar"> <?php else: ?> <?php $initials = $initials ?? implode('', array_map(function($w) { return mb_strtoupper(mb_substr($w, 0, 1)); }, array_slice(explode(' ', $article_meta['author_name']), 0, 2))); ?> <span class="author-box-avatar avatar-initials"><?php echo $initials; ?></span> <?php endif; ?> <div> <div class="author-box-name"><?php echo htmlspecialchars($article_meta['author_name']); ?></div> <div class="author-box-bio"><?php echo htmlspecialchars($article_meta['author_bio'] ?? ''); ?></div> </div> </div> <a href="/<?php echo $category; ?>/" class="category-link"><?php echo $lang['all_articles'] ?? 'Voir tous les articles'; ?> <?php echo htmlspecialchars($cat_info['name']); ?> →</a> </div> <?php include __DIR__ . '/parts/footer.php'; ?>