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:
parent
d4b7a3f3fb
commit
3f5595144d
3 changed files with 11 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ $entryTopPos ??= 20;
|
||||||
"name": "<?= $page->author() ?>"
|
"name": "<?= $page->author() ?>"
|
||||||
}],
|
}],
|
||||||
"image": "<?= url('assets/images/logo.png') ?>",
|
"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') ?>",
|
"datePublished": "<?= $page->published()->toDate('Y-m-d') ?>",
|
||||||
"dateModified": "<?= $page->modified('Y-m-d') ?>",
|
"dateModified": "<?= $page->modified('Y-m-d') ?>",
|
||||||
"url": "<?= $page->url() ?>",
|
"url": "<?= $page->url() ?>",
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,11 @@
|
||||||
href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
|
href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
|
||||||
<span class="light">publié le
|
<span class="light">publié le
|
||||||
</span><?= $page->published()->toDate('d/m/Y') ?><br>
|
</span><?= $page->published()->toDate('d/m/Y') ?><br>
|
||||||
<span class="light">dans</span> <a
|
<span class="light">dans</span>
|
||||||
href="<?= $page->parent()->url() ?>"><?= $page->parent()->title() ?></a>
|
<?php foreach(allYears($page) as $year): ?>
|
||||||
/ <a
|
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
|
||||||
|
<?php endforeach ?>
|
||||||
|
<a
|
||||||
href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
|
href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
|
||||||
</p>
|
</p>
|
||||||
<?php endslot() ?>
|
<?php endslot() ?>
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,11 @@
|
||||||
href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
|
href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
|
||||||
<span class="light">publié le
|
<span class="light">publié le
|
||||||
</span><?= $page->published()->toDate('d/m/Y') ?><br>
|
</span><?= $page->published()->toDate('d/m/Y') ?><br>
|
||||||
<span class="light">dans</span> <a
|
<span class="light">dans</span>
|
||||||
href="<?= $page->parent()->url() ?>"
|
<?php foreach(allYears($page) as $year): ?>
|
||||||
title="voir les textes liés à l'année <?= $page->parent()->title() ?>"><?= $page->parent()->title() ?></a>
|
<a href="<?= $year->url() ?>" title="voir les textes liés à l'année <?= $year->title() ?>"><?= $year->title() ?></a> /
|
||||||
/ <a href="/categories/<?= Str::slug($page->category()) ?>"
|
<?php endforeach ?>
|
||||||
|
<a href="/categories/<?= Str::slug($page->category()) ?>"
|
||||||
title="voir les textes de la catégorie <?= $page->category() ?>"><?= $page->category() ?></a>
|
title="voir les textes de la catégorie <?= $page->category() ?>"><?= $page->category() ?></a>
|
||||||
</p>
|
</p>
|
||||||
<?php endslot() ?>
|
<?php endslot() ?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue