feat: profile_url auteur → article:author URL + JSON-LD author.url
This commit is contained in:
+11
-5
@@ -43,8 +43,9 @@ $externalLinks = $article['external_links'] ?? [];
|
||||
<div class="private-ribbon">Privé</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$authorEmail = $article['author'] ?? '';
|
||||
$authorName = ($authorEmail !== '' && function_exists('authorDisplayName')) ? authorDisplayName($authorEmail) : '';
|
||||
$authorEmail = $article['author'] ?? '';
|
||||
$authorName = ($authorEmail !== '' && function_exists('authorDisplayName')) ? authorDisplayName($authorEmail) : '';
|
||||
$authorProfileUrl = ($authorEmail !== '' && function_exists('authorProfileUrl')) ? authorProfileUrl($authorEmail) : '';
|
||||
$pubDate = htmlspecialchars(date('d/m/Y', strtotime((string)($article['published_at'] ?? $article['created_at'] ?? ''))));
|
||||
$hasCover = $coverFile !== '';
|
||||
$heroExtraClass = $hasCover ? '' : ' article-cover--gradient';
|
||||
@@ -281,8 +282,9 @@ if ($ogImage === null || $ogImage === '') {
|
||||
$ogImage = $article['og_image'] ?? '';
|
||||
}
|
||||
|
||||
// Auteur : nom affiché résolu depuis le champ author du JSON de l'article
|
||||
$metaAuthor = $authorName;
|
||||
// Auteur : nom et URL de profil résolus depuis le champ author du JSON de l'article
|
||||
$metaAuthor = $authorName;
|
||||
$metaAuthorUrl = $authorProfileUrl;
|
||||
|
||||
// JSON-LD Article
|
||||
$jsonLdData = [
|
||||
@@ -293,7 +295,11 @@ $jsonLdData = [
|
||||
'url' => $canonical,
|
||||
'datePublished' => date('c', strtotime((string)$articlePublishedAt)),
|
||||
'dateModified' => date('c', strtotime((string)($article['updated_at'] ?? $articlePublishedAt))),
|
||||
'author' => ['@type' => 'Person', 'name' => $metaAuthor !== '' ? $metaAuthor : (siteAuthor() !== '' ? siteAuthor() : siteTitle())],
|
||||
'author' => array_filter([
|
||||
'@type' => 'Person',
|
||||
'name' => $metaAuthor !== '' ? $metaAuthor : (siteAuthor() !== '' ? siteAuthor() : siteTitle()),
|
||||
'url' => $metaAuthorUrl !== '' ? $metaAuthorUrl : null,
|
||||
]),
|
||||
'publisher' => [
|
||||
'@type' => 'Person',
|
||||
'name' => siteAuthor() !== '' ? siteAuthor() : siteTitle(),
|
||||
|
||||
Reference in New Issue
Block a user