actuel-inactuel/site/templates/year.php

57 lines
1.9 KiB
PHP
Raw Normal View History

2025-02-03 15:29:26 +01:00
<?php snippet('header') ?>
2024-04-10 16:52:41 +02:00
<main id="<?= $page->template() ?>">
2025-02-03 15:29:26 +01:00
<article>
<?php snippet('cover', array('isOpen' => true), slots: true) ?>
<?php slot('title') ?>
2025-02-03 16:39:43 +01:00
<h1 class="main-title">année <?= $page->title() ?></h1>
<?php if ($page->openDate()->isNotEmpty()): ?>
<p>
<span class="light">ouverte depuis le </span><?= $page->openDate()->toDate('d/m/Y') ?>
</p>
<?php endif ?>
2025-02-03 15:29:26 +01:00
<?php endslot() ?>
<?php endsnippet() ?>
2025-02-03 16:32:36 +01:00
<div id="main-content"
x-data="{
edito: false
}"
>
<?php if ($page->edito()->isNotEmpty()): ?>
<div
id="edito"
:class="edito ? '' : 'short'"
>
<?= $page->edito() ?>
2024-04-10 16:52:41 +02:00
</div>
2025-02-03 16:32:36 +01:00
<button
:class="edito ? 'open' : 'close'"
class="see-more toggle-btn toggle-btn--left"
@click="edito = !edito"
>Lire</button>
2025-02-03 15:29:26 +01:00
<?php endif ?>
<ul class="texts">
<?php foreach($page->children() as $article): ?>
<li
class="text"
>
<a href="<?= $article->url() ?>" class="text__title no-underline">
<h4><?= $article->title() ?></h4>
</a>
<div class="text__infos">
<p>
<span class="light">par</span>
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>
</li>
<?php endforeach ?>
</div>
</article>
</main>
<?php snippet('footer') ?>