Rewrite for Kirby

This commit is contained in:
Marcel Kapfer 2024-03-17 22:34:51 +01:00
parent 07201d05de
commit f854d60108
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
116 changed files with 4156 additions and 8875 deletions
site/snippets

28
site/snippets/article.php Normal file
View file

@ -0,0 +1,28 @@
<article>
<h2><a href="<?= $article->url() ?>"><?= $article->title() ?></a></h2>
<p id="date"><?= $article->date()->toDate('Y-m-d') ?></p>
<p>
<div class="tagories">
<?php if ($article->categories()->isNotEmpty()): ?>
<span id="categories">
<?php foreach ($article->categories()->split() as $category): ?>
<a href="/blog/category/<?= $category ?>"><?= $category ?></a>
<?php endforeach ?>
</span>
<?php endif ?>
<?php if ($article->tags()->isNotEmpty()): ?>
<span id="tags">
<?php foreach ($article->tags()->split() as $tag): ?>
<a href="/blog/tag/<?= $tag ?>"><?= $tag ?></a>
<?php endforeach ?>
</span>
<?php endif ?>
</div>
</p>
<p>
<?= $article->text()->excerpt(300) ?>
</p>
<p><a href="<?= $article->url() ?>">Read more</a></p>
</article>