Generate archive
This commit is contained in:
parent
c59c266ee1
commit
d1eb6f1762
2 changed files with 27 additions and 1 deletions
|
@ -222,6 +222,31 @@ method generate-index($db) {
|
|||
"<!doctype html>$html"
|
||||
}
|
||||
|
||||
method generate-archive($db) {
|
||||
my @most-recent =
|
||||
$db.sorted-posts
|
||||
.grep(!*.value.hidden)
|
||||
.map(-> $pair {
|
||||
self.generate-blurb: $pair.key, $db
|
||||
});
|
||||
|
||||
my $head = self.generate-head(Nil, $db.meta);
|
||||
my $body = body [
|
||||
self.site-header: $db.meta;
|
||||
div :class<post-blurbs>, [
|
||||
h1 "All Posts"
|
||||
], @most-recent;
|
||||
];
|
||||
|
||||
my $html =
|
||||
html :lang<en>, [
|
||||
$head,
|
||||
$body
|
||||
];
|
||||
|
||||
"<!doctype html>$html"
|
||||
}
|
||||
|
||||
sub icon($icon) {
|
||||
i(:class("bx bx-$icon"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue