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

23 lines
800 B
PHP
Raw Normal View History

<?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">
2021-01-24 17:05:39 +00:00
<time datetime="<?php echo $a->date()->toDate('Y-m-d') ?>"><?php echo $a->date()->toDate('d. M. Y') ?></time>
<?php echo tags_html($base_url, $a); ?>
</div>
</article>