nav - show subtitles

This commit is contained in:
isUnknown 2025-02-06 13:03:33 +01:00
parent 3a6ff118bc
commit d54ed28aa0
3 changed files with 73 additions and 78 deletions

View file

@ -1,34 +1,39 @@
<ul class="texts panel__all-texts panel-item-content__texts hidden">
<?php foreach(page('textes')->grandChildren()->sortBy('published', 'desc') as $article): ?>
<?php
$author = $article->author()->toPage() == null ? "inconnu" : $article->author()->toPage()->title();
?>
<li
class="text"
x-data="{
<?php
$author = $article->author()->toPage() == null ? 'inconnu' : $article->author()->toPage()->title();
?>
<li class="text" x-data="{
title: '<?= str_replace("'", "\'", $article->title()->value()) ?>',
author: '<?= $author ?>',
category: '<?= $article->category() ?>',
keywords: '<?= $article->keywords() ?>',
}"
x-show="
}" x-show="
slugify(title).includes(slugify(search))
|| slugify(author).includes(slugify(search))
|| slugify(category).includes(slugify(search))
|| slugify(keywords).includes(slugify(search))
"
>
<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($author) ?>"><?= $author ?></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>
">
<a href="<?= $article->url() ?>"
class="text__title no-underline">
<h4><?= $article->title() ?></h4>
<?php if ($article->subtitle()->isNotEmpty()): ?>
<p><?= $article->subtitle() ?></p>
<?php endif ?>
</a>
<div class="text__infos">
<p>
<span class="light">par</span>
<a class="author"
href="/auteurs/<?= Str::slug($author) ?>"><?= $author ?></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 ?>
</ul>