forked from laysense/laysense.cn
30 lines
1.5 KiB
PHP
30 lines
1.5 KiB
PHP
<?php
|
|
use App\Content\Repository;
|
|
use App\Content\View;
|
|
|
|
$e = View::escape(...);
|
|
?>
|
|
<section class="section article-page" aria-labelledby="archive-title" data-enter>
|
|
<div class="wrap">
|
|
<div class="section-heading">
|
|
<?php if ($tag || $category): ?><a class="back-link" href="/articles">全部动态</a><?php endif ?>
|
|
<h1 id="archive-title"><?= $e($headline) ?></h1>
|
|
<p>来笙的公告、新闻和产品动态。</p>
|
|
</div>
|
|
<nav class="filter-nav" aria-label="动态分类">
|
|
<a href="/articles" <?= !$category && !$tag ? 'aria-current="page"' : '' ?>>全部</a>
|
|
<?php foreach (Repository::CATEGORIES as $key => $label): ?>
|
|
<a href="/articles/category/<?= $e($key) ?>" <?= $category === $key ? 'aria-current="page"' : '' ?>><?= $e($label) ?></a>
|
|
<?php endforeach ?>
|
|
</nav>
|
|
<?= View::fragment('article-list', ['articles' => $articles]) ?>
|
|
<?php if ($pageNumber > 1 || $hasNext): ?>
|
|
<nav class="pagination" aria-label="动态分页">
|
|
<?php if ($pageNumber > 1): ?><a class="button button-outline" href="<?= $e($archivePath . ($pageNumber > 2 ? '?page=' . ($pageNumber - 1) : '')) ?>" rel="prev">上一页</a><?php endif ?>
|
|
<span>第 <?= $e($pageNumber) ?> 页</span>
|
|
<?php if ($hasNext): ?><a class="button button-outline" href="<?= $e($archivePath . '?page=' . ($pageNumber + 1)) ?>" rel="next">下一页</a><?php endif ?>
|
|
</nav>
|
|
<?php endif ?>
|
|
</div>
|
|
</section>
|