Generate series pages
This commit is contained in:
parent
7cf4827d0c
commit
baf8d6556b
8 changed files with 168 additions and 41 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue