Edited at time

This commit is contained in:
Nathan McCarty 2025-02-05 03:45:01 -05:00
parent 73aefa28eb
commit 7d5cbfba3c
3 changed files with 38 additions and 2 deletions

16
blog
View file

@ -118,6 +118,22 @@ multi MAIN(
say 'Post has slugs: ', $db.posts{$id}.all-slugs;
}
#| Update the last editied time on a post
multi MAIN(
"touch",
#| The post id to touch
Int:D $id,
#| The path of the database file
IO::Path(Str) :$db-dir = $default-db-dir,
#| The date/time the post should be recorded as laste edited at
DateTime(Str) :$edited-at = DateTime.now,
) {
my $db = read-db $db-dir;
my $post = $db.posts{$id.Int};
$post.edited-at.push: $edited-at;
$db.write: $db-dir;
}
#| Render the blog to html
multi MAIN(
"render",