KT-personal-website/template/posts.php

38 lines
1 KiB
PHP
Raw Permalink Normal View History

2024-10-22 12:26:08 +02:00
<?php
use App\Blogs\Blogs;
?>
<main class="blog">
<section>
<nav aria-label="breadcrumb" class="breadcrumb">
<ul>
<li><a href="/posts">Posts</a></li>
<li><a href="/posts/<?= $this->page; ?>"><?= $this->page; ?></a></li>
</ul>
</nav>
</section>
<section>
<?php foreach ($getPostList as $key => $post): ?>
<article class="card">
<div class="card-header">
<h3><a href="/post/<?= $key; ?>"><?= $post['title']; ?></a></h3>
</div>
<div>
<?= Blogs::extractLead(file_get_contents($post['file'])); ?>
</div>
<div class="card-footer">
<time datetime="2024-09-01"><?= $post['created_at']; ?></time>
</div>
</article>
<?php endforeach; ?>
<nav>
<ul class="pagination">
<?= $pagination; ?>
</ul>
</nav>
</section>
</main>