add json ld schema

This commit is contained in:
isUnknown 2024-09-05 08:28:00 +02:00
parent 2a5ab1424b
commit db8669d30d
2 changed files with 18 additions and 0 deletions

BIN
assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -15,6 +15,24 @@ $entryTopPos = $entryTopPos ?? 20;
<script defer src="<?= url('assets/js/ragadjust.js') ?>"></script>
<meta name="robots" content="noindex, nofollow, noarchive">
<?php if ($page->template() == 'linear' || $page->template() == 'grid'): ?>
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@type":"NewsArticle",
"headline":"<?= $page->title() ?>",
"author":[{"@type": "Person","name": "<?= $page->author() ?>"}],
"image":"<?= url('assets/images/logo.png') ?>",
"description":"<?= $page->title() ?>, par <?= $page->author()->toUser()->name() ?>. Publié le <?= $page->published()->toDate('d/m/Y') ?> dans <?= $page->parent()->title() ?>/<?= $page->category() ?>",
"datePublished":"<?= $page->published()->toDate('Y-m-d') ?>",
"dateModified":"<?= $page->modified('Y-m-d') ?>",
"url":"<?= $page->url() ?>",
"mainEntityOfPage":{"@type":"WebPage","@id":"<?= $page->url() ?>"},
"publisher":{"@type":"Organization","name":"actuel - inactuel"}
}
</script>
<?php endif ?>
</head>
<body class="background-grid <?= e($page->fullWidth() == 'true', 'full-width') ?>" data-template="<?= $page->template() ?>" >
<header id="main-header">