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
+53 -28
View File
@@ -1278,6 +1278,24 @@ footer.mt-5 { margin-top: 0 !important; }
.author-profile-link:hover { color: var(--vl-accent); }
.liens-cta {
display: inline-block;
margin-top: .625rem;
padding: .5rem 1.25rem;
border-radius: 100px;
background: var(--vl-accent);
color: #fff;
font-size: .875rem;
font-weight: 700;
text-decoration: none;
transition: background .2s, transform .15s;
}
.liens-cta:hover {
background: var(--vl-accent-dark);
color: #fff;
transform: translateY(-1px);
}
.author-bio-wrap {
flex: 1;
}
@@ -1309,30 +1327,30 @@ footer.mt-5 { margin-top: 0 !important; }
/* ─── Page "Mes liens" ───────────────────── */
.liens-page {
max-width: 480px;
max-width: 520px;
margin: 0 auto;
padding: 2.5rem 1rem 4rem;
padding: 3rem 1.25rem 5rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
gap: 2.5rem;
}
.liens-header {
display: flex;
flex-direction: column;
align-items: center;
gap: .75rem;
gap: 1rem;
text-align: center;
}
.liens-avatar {
width: 5rem;
height: 5rem;
width: 6rem;
height: 6rem;
border-radius: 50%;
background: var(--vl-accent);
color: #fff;
font-size: 2rem;
font-size: 2.5rem;
font-weight: 700;
display: flex;
align-items: center;
@@ -1340,59 +1358,64 @@ footer.mt-5 { margin-top: 0 !important; }
}
.liens-name {
font-size: 1.25rem;
font-size: 1.5rem;
font-weight: 700;
margin: 0;
}
.liens-bio {
font-size: .9rem;
font-size: .9375rem;
color: var(--vl-muted);
line-height: 1.6;
margin: 0;
}
.liens-sep {
width: 100%;
border: none;
border-top: 1.5px solid var(--vl-border);
margin: 0;
}
.liens-list {
width: 100%;
display: flex;
flex-direction: column;
gap: .75rem;
gap: 1rem;
}
.liens-item {
display: flex;
flex-direction: column;
align-items: center;
gap: .2rem;
gap: .3rem;
width: 100%;
padding: .875rem 1.25rem;
border-radius: var(--vl-radius);
border: 1.5px solid var(--vl-border);
background: var(--vl-surface);
padding: 1.125rem 1.75rem;
border-radius: 100px;
border: none;
background: var(--btn-bg, var(--vl-accent));
text-align: center;
text-decoration: none;
color: var(--vl-text);
font-weight: 600;
transition: border-color .15s, background .15s, transform .1s;
box-shadow: var(--vl-shadow-sm);
color: #fff;
font-weight: 700;
transition: filter .2s, transform .15s, box-shadow .2s;
box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.liens-item:hover {
border-color: var(--vl-accent);
background: var(--vl-accent-soft);
color: var(--vl-accent);
transform: translateY(-1px);
box-shadow: var(--vl-shadow-md);
color: #fff;
filter: brightness(1.12);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.liens-item-title { font-size: 1rem; }
.liens-item-title { font-size: 1.125rem; }
.liens-item-desc {
font-size: .8rem;
font-size: .85rem;
font-weight: 400;
color: var(--vl-muted);
color: rgba(255,255,255,.8);
}
.liens-item:hover .liens-item-desc { color: var(--vl-accent); opacity: .8; }
.liens-footer {
font-size: .8rem;
@@ -1401,6 +1424,8 @@ footer.mt-5 { margin-top: 0 !important; }
.liens-footer a { color: inherit; }
.liens-footer a:hover { color: var(--vl-accent); }
.liens-bg { background: #f1f5f9; }
/* ─── Agrégateur de flux ─────────────────── */
.flux-list {
-1
View File
@@ -1772,7 +1772,6 @@ switch ($action) {
saveSiteSettings([
'site_title' => $_POST['site_title'] ?? '',
'site_claim' => $_POST['site_claim'] ?? '',
'site_author' => $_POST['site_author'] ?? '',
'site_lang' => $_POST['site_lang'] ?? '',
'posts_per_page' => $_POST['posts_per_page'] ?? '',
'site_license_label' => $_POST['site_license_label'] ?? '',
+1 -6
View File
@@ -34,11 +34,6 @@ function siteClaim(): string
return siteSettings()['site_claim'] ?? 'journal de Cédrix · informatique, hack & loisirs';
}
function siteAuthor(): string
{
return siteSettings()['site_author'] ?? '';
}
function siteLang(): string
{
return siteSettings()['site_lang'] ?? 'fr-FR';
@@ -67,7 +62,7 @@ function siteLicenseUrl(): string
function saveSiteSettings(array $data): void
{
$current = siteSettings();
$stringKeys = ['site_title', 'site_claim', 'site_author', 'site_lang', 'site_license_label', 'site_license_url'];
$stringKeys = ['site_title', 'site_claim', 'site_lang', 'site_license_label', 'site_license_url'];
foreach ($stringKeys as $key) {
if (array_key_exists($key, $data)) {
$val = trim((string)$data[$key]);
-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(),