fix #15
This commit is contained in:
parent
1e91353c86
commit
fc267d80d1
5 changed files with 110 additions and 51 deletions
|
|
@ -1,36 +1,58 @@
|
|||
<?php snippet('header'); ?>
|
||||
|
||||
<?php snippet('header') ?>
|
||||
<main id="<?= $page->template() ?>">
|
||||
<article>
|
||||
<?php snippet('cover', slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<?php endslot() ?>
|
||||
<?php slot('text') ?>
|
||||
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
|
||||
<article>
|
||||
<?php snippet('cover', array('isOpen' => true), slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<h1 class="main-title"><?= $page->title() ?></h1>
|
||||
<?php endslot() ?>
|
||||
<?php endsnippet() ?>
|
||||
|
||||
<div id="main-content"
|
||||
x-data="{
|
||||
edito: false
|
||||
}"
|
||||
>
|
||||
<?php if ($page->edito()->isNotEmpty()): ?>
|
||||
<div
|
||||
id="edito"
|
||||
:class="edito ? '' : 'short'"
|
||||
>
|
||||
<?= $page->edito() ?>
|
||||
</div>
|
||||
<button
|
||||
:class="edito ? 'open' : 'close'"
|
||||
class="see-more toggle-btn toggle-btn--left"
|
||||
@click="edito = !edito"
|
||||
>Lire</button>
|
||||
<?php endif ?>
|
||||
<ul class="texts">
|
||||
<?php foreach($kirby->collection('categories') as $category): ?>
|
||||
<?php if ($category->title() == $page->title()): ?>
|
||||
<?php foreach($category['texts'] 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 ?>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?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>
|
||||
<?php
|
||||
try {
|
||||
echo $article->author()->toPage()->title();
|
||||
} catch (\Throwable $th) {
|
||||
throw new Exception(json_encode($article->author()), 1);
|
||||
|
||||
}
|
||||
?>
|
||||
<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 ?>
|
||||
<?php endslot() ?>
|
||||
<?php endsnippet() ?>
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue