]> git.bts.cx Git - cx.git/blob - cx/templates/public/post.php
post metadata support (not very good yet)
[cx.git] / cx / templates / public / post.php
1 <?php $post = cx_posts_find_post($post_id); ?>
2 <?php $post_metadata = $post->get_metadata(); ?>
3 <?php $post_permalink = '/' . date('Y', $post->date) . '/' . date('m', $post->date) . '/' . $post->slug; ?>
4 <?php cx_template_base('base', ['cx_post_meta' => $post_metadata, 'cx_post_permalink' => $post_permalink]); ?>
5 <main>
6 <?php if ($post): ?>
7 <article>
8 <h1><a href="<?= cx_url($post_permalink) ?>"><?= $post->title ?></a></h1>
9 <p class="updated"><?= date('l, F jS, Y',$post->date) ?></p>
10 <?= $post->html_content ?>
11 </article>
12 <?php else: ?>
13 <p>Nothing found.</p>
14 <?php endif; ?>
15
16 </main>