Generate Index

This commit is contained in:
Nathan McCarty 2025-02-05 03:26:39 -05:00
parent d861c7ef87
commit c59c266ee1
4 changed files with 115 additions and 12 deletions

View file

@ -83,17 +83,23 @@ class PostDB {
$id-path.spurt: $html;
for $post.all-slugs -> $slug {
# remove the symlink if it already exists
my $slug-path = $by-slug.add: $slug;
my $slug-path = $by-slug.add: "$slug.html";
$slug-path.unlink if $slug-path.l;
$id-path.symlink: $slug-path;
}
}
# Render the archive
# Render the rss/atom feed
# Render the index
# Symlink the about article
$out-dir.add('index.html').spurt: $config.generate-index(self);
# TODO: Render the archive
# TODO: Render the rss/atom feed
# TODO: Symlink the about article
die "Not Implemented"
}
#| Get a list of posts sorted by date
method sorted-posts() {
%!posts.sort(*.value.posted-at).reverse
}
}
#| Read the database out of a directory