41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
$pageTitle = 'Notes';
|
|
$metaDescription = 'Short notes and thoughts.';
|
|
|
|
$notes = array_values(array_filter(
|
|
get_all_posts(false),
|
|
fn(array $post): bool => ($post['layout'] ?? '') === 'notes'
|
|
));
|
|
?>
|
|
<?php require PUREBLOG_BASE_PATH . '/includes/header.php'; ?>
|
|
<?php render_masthead_layout($config, []); ?>
|
|
|
|
<main>
|
|
<h1>Notes</h1>
|
|
|
|
<?php if (empty($notes)): ?>
|
|
<p>No notes yet.</p>
|
|
<?php else: ?>
|
|
<div class="notes-feed">
|
|
<?php foreach ($notes as $note): ?>
|
|
<article class="note-card">
|
|
<div class="note-card-body">
|
|
<?= render_markdown($note['content'], ['post_title' => '']) ?>
|
|
</div>
|
|
<footer class="note-card-footer">
|
|
<p class="note-timestamp">
|
|
<a href="<?= e(base_path() . '/' . $note['slug']) ?>">
|
|
<time datetime="<?= e(format_datetime_for_display((string) ($note['date'] ?? ''), $config, 'c')) ?>"><?= e(format_post_date_for_display((string) ($note['date'] ?? ''), $config)) ?></time>
|
|
</a>
|
|
</p>
|
|
</footer>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<?php render_footer_layout($config, []); ?>
|
|
</body>
|
|
</html>
|