Files

36 lines
1.8 KiB
PHP

<?php
use App\Content\Repository;
use App\Content\View;
$e = View::escape(...);
?>
<article class="section article-page" itemscope itemtype="https://schema.org/Article" data-enter>
<div class="wrap reading-wrap">
<a class="back-link" href="/articles">全部动态</a>
<header class="section-heading">
<div class="article-meta">
<a href="/articles/category/<?= $e($article['category']) ?>" itemprop="articleSection"><?= $e(Repository::CATEGORIES[$article['category']]) ?></a>
<time itemprop="datePublished" datetime="<?= $e(View::date($article['published_at'], DATE_ATOM)) ?>"><?= $e(View::date($article['published_at'])) ?></time>
<meta itemprop="dateModified" content="<?= $e(View::date($article['updated_at'], DATE_ATOM)) ?>">
</div>
<h1 itemprop="headline"><?= $e($article['title']) ?></h1>
<?php if ($article['summary']): ?><p itemprop="description"><?= $e($article['summary']) ?></p><?php endif ?>
<span itemprop="author" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="<?= $e($site['name']) ?>"></span>
</header>
<div class="rich prose" itemprop="articleBody">
<?php if (trim($articleHtml) !== ''): ?>
<?= $articleHtml ?>
<?php else: ?>
<p class="empty-state">此公告的原文暂不可用。</p>
<?php endif ?>
</div>
<?php if ($article['tags']): ?>
<nav class="filter-nav" aria-label="文章标签">
<?php foreach ($article['tags'] as $tag): ?>
<a href="/articles/tag/<?= $e(rawurlencode($tag)) ?>"><?= $e($tag) ?></a>
<?php endforeach ?>
</nav>
<?php endif ?>
</div>
</article>