Generate series pages

This commit is contained in:
Nathan McCarty 2025-02-09 05:28:59 -05:00
parent 7cf4827d0c
commit baf8d6556b
8 changed files with 168 additions and 41 deletions

View file

@ -22,3 +22,14 @@ method contains-post(Int:D $post-id --> Bool:D) {
False
}
}
#| Returns the date of the lastest post
method latest-post($db) {
my @posts = @!post-ids.map(-> $i {$db.posts{$i}});
if @posts {
my $most-recent-post = @posts.max(*.posted-at);
$most-recent-post.posted-at
} else {
Nil
}
}