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

@ -16,3 +16,16 @@ has Int:D $.placeholder-id is rw = 0;
#| The id of the about post
has Int:D $.about-id is rw = 0;
#| The base url of this post
has Str:D $.base-url is required;
#| Return the base url, but substitute it out if the test environment variable
#| is set
method get-base-url(--> Str:D) {
if %*ENV<BLOG_TEST> {
"http://localhost:8080"
} else {
$!base-url
}
}

View file

@ -43,6 +43,15 @@ has Bool:D $.hidden is json is rw = False;
#| document produced it
method title(--> Str:D) {...}
#| The time the post was last updated at
method updated(--> DateTime:D) {
if @!edited-at {
@!edited-at.max
} else {
$!posted-at
}
}
#| Get the list of slugs for this post, including ones auto generated from
#| the title, as well as any additional slugs
method all-slugs(--> Array[Str:D]) {