j'avais oublié : header.php, linear.php, grid.php pour l'implémentation du allYears(). Peut-etr que ça vaudrait le coup de refactorisé tout ça parceque ça fait beaucoup de duplication

This commit is contained in:
antonin gallon 2026-02-09 22:44:13 +01:00
parent d4b7a3f3fb
commit 3f5595144d
3 changed files with 11 additions and 8 deletions

View file

@ -37,7 +37,7 @@ $entryTopPos ??= 20;
"name": "<?= $page->author() ?>"
}],
"image": "<?= url('assets/images/logo.png') ?>",
"description": "<?= $page->title() ?>, par <?= $page->author()->toPage()->title() ?>. Publié le <?= $page->published()->toDate('d/m/Y') ?> dans <?= $page->parent()->title() ?>/<?= $page->category() ?>",
"description": "<?= $page->title() ?>, par <?= $page->author()->toPage()->title() ?>. Publié le <?= $page->published()->toDate('d/m/Y') ?> dans <?= implode(', ', allYears($page)->pluck('title')) ?>/<?= $page->category() ?>",
"datePublished": "<?= $page->published()->toDate('Y-m-d') ?>",
"dateModified": "<?= $page->modified('Y-m-d') ?>",
"url": "<?= $page->url() ?>",

View file

@ -12,9 +12,11 @@
href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
<span class="light">publié le
</span><?= $page->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span> <a
href="<?= $page->parent()->url() ?>"><?= $page->parent()->title() ?></a>
/ <a
<span class="light">dans</span>
<?php foreach(allYears($page) as $year): ?>
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a
href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
</p>
<?php endslot() ?>

View file

@ -14,10 +14,11 @@
href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
<span class="light">publié le
</span><?= $page->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span> <a
href="<?= $page->parent()->url() ?>"
title="voir les textes liés à l'année <?= $page->parent()->title() ?>"><?= $page->parent()->title() ?></a>
/ <a href="/categories/<?= Str::slug($page->category()) ?>"
<span class="light">dans</span>
<?php foreach(allYears($page) as $year): ?>
<a href="<?= $year->url() ?>" title="voir les textes liés à l'année <?= $year->title() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a href="/categories/<?= Str::slug($page->category()) ?>"
title="voir les textes de la catégorie <?= $page->category() ?>"><?= $page->category() ?></a>
</p>
<?php endslot() ?>