agnes-dot-love-pureblog/content/includes/notes.php

42 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2026-11-18 03:01:10 +00:00
<?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>