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); } .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 { .author-bio-wrap {
flex: 1; flex: 1;
} }
@@ -1309,30 +1327,30 @@ footer.mt-5 { margin-top: 0 !important; }
/* ─── Page "Mes liens" ───────────────────── */ /* ─── Page "Mes liens" ───────────────────── */
.liens-page { .liens-page {
max-width: 480px; max-width: 520px;
margin: 0 auto; margin: 0 auto;
padding: 2.5rem 1rem 4rem; padding: 3rem 1.25rem 5rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 2rem; gap: 2.5rem;
} }
.liens-header { .liens-header {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: .75rem; gap: 1rem;
text-align: center; text-align: center;
} }
.liens-avatar { .liens-avatar {
width: 5rem; width: 6rem;
height: 5rem; height: 6rem;
border-radius: 50%; border-radius: 50%;
background: var(--vl-accent); background: var(--vl-accent);
color: #fff; color: #fff;
font-size: 2rem; font-size: 2.5rem;
font-weight: 700; font-weight: 700;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -1340,59 +1358,64 @@ footer.mt-5 { margin-top: 0 !important; }
} }
.liens-name { .liens-name {
font-size: 1.25rem; font-size: 1.5rem;
font-weight: 700; font-weight: 700;
margin: 0; margin: 0;
} }
.liens-bio { .liens-bio {
font-size: .9rem; font-size: .9375rem;
color: var(--vl-muted); color: var(--vl-muted);
line-height: 1.6; line-height: 1.6;
margin: 0; margin: 0;
} }
.liens-sep {
width: 100%;
border: none;
border-top: 1.5px solid var(--vl-border);
margin: 0;
}
.liens-list { .liens-list {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: .75rem; gap: 1rem;
} }
.liens-item { .liens-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: .2rem; gap: .3rem;
width: 100%; width: 100%;
padding: .875rem 1.25rem; padding: 1.125rem 1.75rem;
border-radius: var(--vl-radius); border-radius: 100px;
border: 1.5px solid var(--vl-border); border: none;
background: var(--vl-surface); background: var(--btn-bg, var(--vl-accent));
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
color: var(--vl-text); color: #fff;
font-weight: 600; font-weight: 700;
transition: border-color .15s, background .15s, transform .1s; transition: filter .2s, transform .15s, box-shadow .2s;
box-shadow: var(--vl-shadow-sm); box-shadow: 0 2px 8px rgba(0,0,0,.12);
} }
.liens-item:hover { .liens-item:hover {
border-color: var(--vl-accent); color: #fff;
background: var(--vl-accent-soft); filter: brightness(1.12);
color: var(--vl-accent); transform: translateY(-2px);
transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.18);
box-shadow: var(--vl-shadow-md);
} }
.liens-item-title { font-size: 1rem; } .liens-item-title { font-size: 1.125rem; }
.liens-item-desc { .liens-item-desc {
font-size: .8rem; font-size: .85rem;
font-weight: 400; 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 { .liens-footer {
font-size: .8rem; font-size: .8rem;
@@ -1401,6 +1424,8 @@ footer.mt-5 { margin-top: 0 !important; }
.liens-footer a { color: inherit; } .liens-footer a { color: inherit; }
.liens-footer a:hover { color: var(--vl-accent); } .liens-footer a:hover { color: var(--vl-accent); }
.liens-bg { background: #f1f5f9; }
/* ─── Agrégateur de flux ─────────────────── */ /* ─── Agrégateur de flux ─────────────────── */
.flux-list { .flux-list {
-1
View File
@@ -1772,7 +1772,6 @@ switch ($action) {
saveSiteSettings([ saveSiteSettings([
'site_title' => $_POST['site_title'] ?? '', 'site_title' => $_POST['site_title'] ?? '',
'site_claim' => $_POST['site_claim'] ?? '', 'site_claim' => $_POST['site_claim'] ?? '',
'site_author' => $_POST['site_author'] ?? '',
'site_lang' => $_POST['site_lang'] ?? '', 'site_lang' => $_POST['site_lang'] ?? '',
'posts_per_page' => $_POST['posts_per_page'] ?? '', 'posts_per_page' => $_POST['posts_per_page'] ?? '',
'site_license_label' => $_POST['site_license_label'] ?? '', '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'; return siteSettings()['site_claim'] ?? 'journal de Cédrix · informatique, hack & loisirs';
} }
function siteAuthor(): string
{
return siteSettings()['site_author'] ?? '';
}
function siteLang(): string function siteLang(): string
{ {
return siteSettings()['site_lang'] ?? 'fr-FR'; return siteSettings()['site_lang'] ?? 'fr-FR';
@@ -67,7 +62,7 @@ function siteLicenseUrl(): string
function saveSiteSettings(array $data): void function saveSiteSettings(array $data): void
{ {
$current = siteSettings(); $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) { foreach ($stringKeys as $key) {
if (array_key_exists($key, $data)) { if (array_key_exists($key, $data)) {
$val = trim((string)$data[$key]); $val = trim((string)$data[$key]);
-8
View File
@@ -352,14 +352,6 @@ function adminStatusBadge(array $a, int $now): string
required maxlength="200"> required maxlength="200">
<div class="form-text">Affiché sous le titre dans la navbar et dans le pied de page.</div> <div class="form-text">Affiché sous le titre dans la navbar et dans le pied de page.</div>
</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"> <div class="mb-3">
<label for="site-lang" class="form-label small fw-semibold">Langue du site</label> <label for="site-lang" class="form-label small fw-semibold">Langue du site</label>
<input type="text" id="site-lang" name="site_lang" <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) ?> ↗ <?= htmlspecialchars(parse_url($_apUrl, PHP_URL_HOST) ?: $_apUrl) ?> ↗
</a> </a>
<?php endif; ?> <?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> </div>
<?php if ($_apBio !== ''): ?> <?php if ($_apBio !== ''): ?>
<div class="author-bio-wrap"> <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> <p class="text-muted">Aucun article publié.</p>
<?php else: ?> <?php else: ?>
<div class="post-grid"> <div class="post-grid">
<?php foreach ($authorArticles as $post): <?php foreach (array_slice($authorArticles, 0, 6) as $post):
$html = $Parsedown->text($post['content']); $html = $Parsedown->text($post['content']);
$preview = mb_strimwidth(strip_tags($html), 0, 120, '…'); $preview = mb_strimwidth(strip_tags($html), 0, 120, '…');
$category = trim((string)($post['category'] ?? '')); $category = trim((string)($post['category'] ?? ''));
@@ -80,6 +80,11 @@ $_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');
</article> </article>
<?php endforeach; ?> <?php endforeach; ?>
</div> </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 endif; ?>
<?php <?php
+1 -1
View File
@@ -49,7 +49,7 @@
<link rel="stylesheet" href="/assets/css/style.css"> <link rel="stylesheet" href="/assets/css/style.css">
</head> </head>
<body> <body<?php if (!empty($bodyClass ?? '')): ?> class="<?= htmlspecialchars($bodyClass) ?>"<?php endif; ?>>
<header> <header>
<nav class="navbar navbar-expand-lg navbar-dark mb-0" role="navigation" aria-label="Navigation principale"> <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; ?> <?php endif; ?>
</div> </div>
<?php if (!empty($profileLinks)): ?>
<hr class="liens-sep">
<?php endif; ?>
<div class="liens-list"> <div class="liens-list">
<?php foreach ($profileLinks as $_link): ?> <?php
<a href="<?= htmlspecialchars($_link['url']) ?>" target="_blank" rel="noopener" class="liens-item"> $_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> <span class="liens-item-title"><?= htmlspecialchars($_link['title'] ?: $_link['url']) ?></span>
<?php if ($_link['description'] !== ''): ?> <?php if ($_link['description'] !== ''): ?>
<span class="liens-item-desc"><?= htmlspecialchars($_link['description']) ?></span> <span class="liens-item-desc"><?= htmlspecialchars($_link['description']) ?></span>
@@ -30,6 +39,7 @@
</div> </div>
<?php <?php
$bodyClass = 'liens-bg';
$content = ob_get_clean(); $content = ob_get_clean();
$title = 'Liens de ' . htmlspecialchars($_lName) . ' — ' . siteTitle(); $title = 'Liens de ' . htmlspecialchars($_lName) . ' — ' . siteTitle();
$seoTitle = $title; $seoTitle = $title;
+1 -1
View File
@@ -207,7 +207,7 @@ $catVal = trim($category ?? '');
<tbody> <tbody>
<tr> <tr>
<th class="text-muted fw-normal ps-0 pe-2 text-nowrap" style="width:1%">Auteur</th> <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>
<tr> <tr>
<th class="text-muted fw-normal ps-0 pe-2 text-nowrap">Publication</th> <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))), 'dateModified' => date('c', strtotime((string)($article['updated_at'] ?? $articlePublishedAt))),
'author' => array_filter([ 'author' => array_filter([
'@type' => 'Person', '@type' => 'Person',
'name' => $metaAuthor !== '' ? $metaAuthor : (siteAuthor() !== '' ? siteAuthor() : siteTitle()), 'name' => $metaAuthor !== '' ? $metaAuthor : siteTitle(),
'url' => $metaAuthorUrl !== '' ? $metaAuthorUrl : null, 'url' => $metaAuthorUrl !== '' ? $metaAuthorUrl : null,
]), ]),
'publisher' => [ 'publisher' => [
'@type' => 'Person', '@type' => 'Blog',
'name' => siteAuthor() !== '' ? siteAuthor() : siteTitle(), 'name' => siteTitle(),
'url' => rtrim(APP_URL, '/'), 'url' => rtrim(APP_URL, '/'),
], ],
'inLanguage' => siteLang(), 'inLanguage' => siteLang(),