From f3584159c1ab58fc115cd67f4c538f4ae60bef67 Mon Sep 17 00:00:00 2001 From: Cedric Abonnel Date: Wed, 13 May 2026 00:27:12 +0200 Subject: [PATCH] admin/site: retirer site_author, publisher=Blog, auteur depuis profil utilisateur --- public/assets/css/style.css | 81 +++++++++++++++++++++++------------- public/index.php | 1 - src/SiteSettings.php | 7 +--- templates/admin.php | 8 ---- templates/author_profile.php | 9 +++- templates/layout.php | 2 +- templates/liens.php | 14 ++++++- templates/post_confirm.php | 2 +- templates/post_view.php | 6 +-- 9 files changed, 78 insertions(+), 52 deletions(-) diff --git a/public/assets/css/style.css b/public/assets/css/style.css index a565f6b..850bcef 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -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 { diff --git a/public/index.php b/public/index.php index 7413cc1..5f6abce 100644 --- a/public/index.php +++ b/public/index.php @@ -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'] ?? '', diff --git a/src/SiteSettings.php b/src/SiteSettings.php index 348b110..6c4bbc1 100644 --- a/src/SiteSettings.php +++ b/src/SiteSettings.php @@ -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]); diff --git a/templates/admin.php b/templates/admin.php index 8970e78..b6d015f 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -352,14 +352,6 @@ function adminStatusBadge(array $a, int $now): string required maxlength="200">
Affiché sous le titre dans la navbar et dans le pied de page.
-
- - -
Utilisé dans les métadonnées des articles (meta author, JSON-LD).
-
- Mes liens → + Mes liens
@@ -49,7 +49,7 @@ $_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');

Aucun article publié.

- 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');
+ 6): ?> +

+ Voir tous les articles → +

+ - + class="">
+ +
+ +
- - + $_link): + $_btnBg = $_palette[$_i % count($_palette)]; + ?> + @@ -30,6 +39,7 @@
Auteur - + Publication diff --git a/templates/post_view.php b/templates/post_view.php index d9dc018..54961b1 100644 --- a/templates/post_view.php +++ b/templates/post_view.php @@ -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(),