1
0
Fork 0
web-jbeyerstedt/site/snippets/blogexcerpt.php

23 lines
795 B
PHP

<?php
// -------------------------------------------
// kirby snippet FOR jannikbeyerstedt.de
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
// usage: snippet('blogexcerpt',["article"=>$article,"length"=>200,"base_url"=>$base_url])
// -------------------------------------------
$a = $article;
?>
<article class="excerpt">
<h2><a href="<?php echo $a->url()?>"><?php echo $a->title()->html() ?></a></h2>
<p><?php echo $a->text()->excerpt($length) ?>
<a class="more" href="<?php echo $a->url()?>">»</a>
</p>
<div class="meta">
<time datetime="<?php echo $a->date()->toDate('Y-m-d') ?>"><?php echo $a->date()->toDate('d. M. Y') ?></time>
<?php echo tags($base_url, $a); ?>
</div>
</article>