Basci atom feed generation

This commit is contained in:
Nathan McCarty 2025-02-05 04:37:28 -05:00
parent 7d5cbfba3c
commit 53c0c6a9d6
6 changed files with 101 additions and 7 deletions

View file

@ -72,7 +72,7 @@ method site-header(BlogMeta:D $meta) {
'About';
];
];
a :href</feed.xml>, [
a :href</atom.xml>, [
icon 'rss';
' ';
span [
@ -193,8 +193,8 @@ method generate-blurb(Int:D $id, $db) {
my $desc = $post.description;
my @slugs = $post.all-slugs;
# Use the primary slug if there is one, the id if there isn't
my $link = do if @slugs.elems > 0 {
"/posts/by-slug/{@slugs[0]}.html"
my $link = do if @slugs.elems {
"/posts/by-slug/{@slugs[*-1]}.html"
} else {
"/posts/by-id/$id.html"
}