feat: bio profil + URL publique pré-remplie dans /profile

This commit is contained in:
Cedric Abonnel
2026-05-12 23:53:09 +02:00
parent 20c55aba32
commit d5bf3072f4
6 changed files with 43 additions and 12 deletions
+5 -1
View File
@@ -7,10 +7,11 @@ ob_start();
$_apName = $authorRow['display_name'] ?? '';
$_apUrl = $authorRow['profile_url'] ?? '';
$_apSlug = $authorRow['profile_slug'] ?? '';
$_apBio = $authorRow['bio'] ?? '';
$_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');
?>
<div class="author-profile-hero mb-5">
<div class="author-profile-hero mb-4">
<div class="author-avatar"><?= htmlspecialchars($_initials) ?></div>
<div class="author-profile-info">
<h1 class="author-profile-name"><?= htmlspecialchars($_apName) ?></h1>
@@ -21,6 +22,9 @@ $_initials = mb_strtoupper(mb_substr($_apName, 0, 1, 'UTF-8'), 'UTF-8');
<?php endif; ?>
</div>
</div>
<?php if ($_apBio !== ''): ?>
<p class="author-profile-bio mb-5"><?= nl2br(htmlspecialchars($_apBio)) ?></p>
<?php endif; ?>
<?php if (empty($authorArticles)): ?>
<p class="text-muted">Aucun article publié.</p>
+15 -4
View File
@@ -22,15 +22,26 @@
class="form-control"
value="<?= htmlspecialchars($profileCurrentName) ?>"
placeholder="Prénom Nom" required>
<div class="form-text">Affiché comme auteur sur vos articles.</div>
<div class="form-text">
Affiché comme auteur sur vos articles.
<?php if (($profileCurrentSlug ?? '') !== ''): ?>
Page publique : <a href="/profil/<?= rawurlencode($profileCurrentSlug) ?>">/profil/<?= htmlspecialchars($profileCurrentSlug) ?></a>
<?php endif; ?>
</div>
</div>
<div class="mb-3">
<label class="form-label fw-semibold" for="profile_url">URL de profil</label>
<label class="form-label fw-semibold" for="bio">Biographie</label>
<textarea id="bio" name="bio" class="form-control" rows="4"
placeholder="Quelques mots sur vous…"><?= htmlspecialchars($profileCurrentBio ?? '') ?></textarea>
<div class="form-text">Affichée sur votre page de profil public.</div>
</div>
<div class="mb-3">
<label class="form-label fw-semibold" for="profile_url">URL de profil externe</label>
<input type="url" id="profile_url" name="profile_url"
class="form-control"
value="<?= htmlspecialchars($profileCurrentUrl) ?>"
value="<?= htmlspecialchars($profileCurrentUrl ?? '') ?>"
placeholder="https://example.com/~vous">
<div class="form-text">Utilisée dans les métadonnées de vos articles (article:author, JSON-LD).</div>
<div class="form-text">Lien vers un site ou profil externe (utilisé dans les métadonnées article:author, JSON-LD).</div>
</div>
<div class="mb-3">
<label class="form-label fw-semibold text-muted">Email</label>