admin/site: retirer site_author, publisher=Blog, auteur depuis profil utilisateur

This commit is contained in:
Cedric Abonnel
2026-05-13 00:27:12 +02:00
parent 26c0a03e71
commit f3584159c1
9 changed files with 78 additions and 52 deletions
-8
View File
@@ -352,14 +352,6 @@ function adminStatusBadge(array $a, int $now): string
required maxlength="200">
<div class="form-text">Affiché sous le titre dans la navbar et dans le pied de page.</div>
</div>
<div class="mb-3">
<label for="site-author" class="form-label small fw-semibold">Auteur principal</label>
<input type="text" id="site-author" name="site_author"
class="form-control form-control-sm"
value="<?= htmlspecialchars(siteAuthor()) ?>"
maxlength="100" placeholder="ex : Cédrix">
<div class="form-text">Utilisé dans les métadonnées des articles (meta author, JSON-LD).</div>
</div>
<div class="mb-3">
<label for="site-lang" class="form-label small fw-semibold">Langue du site</label>
<input type="text" id="site-lang" name="site_lang"
+7 -2
View File
@@ -20,7 +20,7 @@ $_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');
<?= htmlspecialchars(parse_url($_apUrl, PHP_URL_HOST) ?: $_apUrl) ?> ↗
</a>
<?php endif; ?>
<a href="/liens/<?= rawurlencode($_apSlug) ?>" class="author-profile-link">Mes liens</a>
<a href="/liens/<?= rawurlencode($_apSlug) ?>" class="liens-cta">Mes liens</a>
</div>
<?php if ($_apBio !== ''): ?>
<div class="author-bio-wrap">
@@ -49,7 +49,7 @@ $_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');
<p class="text-muted">Aucun article publié.</p>
<?php else: ?>
<div class="post-grid">
<?php foreach ($authorArticles as $post):
<?php foreach (array_slice($authorArticles, 0, 6) as $post):
$html = $Parsedown->text($post['content']);
$preview = mb_strimwidth(strip_tags($html), 0, 120, '…');
$category = trim((string)($post['category'] ?? ''));
@@ -80,6 +80,11 @@ $_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');
</article>
<?php endforeach; ?>
</div>
<?php if (count($authorArticles) > 6): ?>
<p class="text-center mt-4">
<a href="/" class="author-profile-link">Voir tous les articles →</a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php
+1 -1
View File
@@ -49,7 +49,7 @@
<link rel="stylesheet" href="/assets/css/style.css">
</head>
<body>
<body<?php if (!empty($bodyClass ?? '')): ?> class="<?= htmlspecialchars($bodyClass) ?>"<?php endif; ?>>
<header>
<nav class="navbar navbar-expand-lg navbar-dark mb-0" role="navigation" aria-label="Navigation principale">
+12 -2
View File
@@ -10,9 +10,18 @@
<?php endif; ?>
</div>
<?php if (!empty($profileLinks)): ?>
<hr class="liens-sep">
<?php endif; ?>
<div class="liens-list">
<?php foreach ($profileLinks as $_link): ?>
<a href="<?= htmlspecialchars($_link['url']) ?>" target="_blank" rel="noopener" class="liens-item">
<?php
$_palette = ['#0d9488','#16a34a','#d97706','#db2777','#7c3aed','#1d4ed8','#0ea5e9'];
foreach ($profileLinks as $_i => $_link):
$_btnBg = $_palette[$_i % count($_palette)];
?>
<a href="<?= htmlspecialchars($_link['url']) ?>" target="_blank" rel="noopener"
class="liens-item" style="--btn-bg:<?= htmlspecialchars($_btnBg) ?>">
<span class="liens-item-title"><?= htmlspecialchars($_link['title'] ?: $_link['url']) ?></span>
<?php if ($_link['description'] !== ''): ?>
<span class="liens-item-desc"><?= htmlspecialchars($_link['description']) ?></span>
@@ -30,6 +39,7 @@
</div>
<?php
$bodyClass = 'liens-bg';
$content = ob_get_clean();
$title = 'Liens de ' . htmlspecialchars($_lName) . ' — ' . siteTitle();
$seoTitle = $title;
+1 -1
View File
@@ -207,7 +207,7 @@ $catVal = trim($category ?? '');
<tbody>
<tr>
<th class="text-muted fw-normal ps-0 pe-2 text-nowrap" style="width:1%">Auteur</th>
<td><?= htmlspecialchars(siteAuthor() ?: '—') ?></td>
<td><?= htmlspecialchars(currentUserName() ?: (currentUserEmail() ?? '—')) ?></td>
</tr>
<tr>
<th class="text-muted fw-normal ps-0 pe-2 text-nowrap">Publication</th>
+3 -3
View File
@@ -302,12 +302,12 @@ $jsonLdData = [
'dateModified' => date('c', strtotime((string)($article['updated_at'] ?? $articlePublishedAt))),
'author' => array_filter([
'@type' => 'Person',
'name' => $metaAuthor !== '' ? $metaAuthor : (siteAuthor() !== '' ? siteAuthor() : siteTitle()),
'name' => $metaAuthor !== '' ? $metaAuthor : siteTitle(),
'url' => $metaAuthorUrl !== '' ? $metaAuthorUrl : null,
]),
'publisher' => [
'@type' => 'Person',
'name' => siteAuthor() !== '' ? siteAuthor() : siteTitle(),
'@type' => 'Blog',
'name' => siteTitle(),
'url' => rtrim(APP_URL, '/'),
],
'inLanguage' => siteLang(),