fix: meta author depuis le champ author de l'article uniquement

This commit is contained in:
Cedric Abonnel
2026-05-12 23:41:19 +02:00
parent 6b32eccebe
commit a031ea960e
+3 -3
View File
@@ -281,8 +281,8 @@ if ($ogImage === null || $ogImage === '') {
$ogImage = $article['og_image'] ?? '';
}
// Auteur : nom affiché de l'article, sinon auteur du site
$metaAuthor = $authorName !== '' ? $authorName : siteAuthor();
// Auteur : nom affiché résolu depuis le champ author du JSON de l'article
$metaAuthor = $authorName;
// JSON-LD Article
$jsonLdData = [
@@ -293,7 +293,7 @@ $jsonLdData = [
'url' => $canonical,
'datePublished' => date('c', strtotime((string)$articlePublishedAt)),
'dateModified' => date('c', strtotime((string)($article['updated_at'] ?? $articlePublishedAt))),
'author' => ['@type' => 'Person', 'name' => $metaAuthor !== '' ? $metaAuthor : siteTitle()],
'author' => ['@type' => 'Person', 'name' => $metaAuthor !== '' ? $metaAuthor : (siteAuthor() !== '' ? siteAuthor() : siteTitle())],
'publisher' => [
'@type' => 'Person',
'name' => siteAuthor() !== '' ? siteAuthor() : siteTitle(),