diff --git a/blog b/blog index 6784af9..5051bef 100755 --- a/blog +++ b/blog @@ -284,6 +284,21 @@ multi MAIN( $db.write: $db-dir; } +#| Update the posted-at time on a post to the current time +multi MAIN( + "post", + "now", + #| The id of the post to update the posted-at time + Int $id, + #| The path of the database directory + IO::Path(Str) :$db-dir = $default-db-dir, +){ + my $db = read-db $db-dir; + my $post = $db.posts{$id.Int}; + $post.posted-at = DateTime.now; + $db.write: $db-dir; +} + #| Create a new series multi MAIN( "series", diff --git a/lib/DB/Post.rakumod b/lib/DB/Post.rakumod index c1e98c7..d231956 100644 --- a/lib/DB/Post.rakumod +++ b/lib/DB/Post.rakumod @@ -16,6 +16,7 @@ IO::Path:D $.source #| The time to display for the creation of the post has DateTime:D $.posted-at + is rw is required is json( :to-json(*.Str), diff --git a/lib/Render/Util.rakumod b/lib/Render/Util.rakumod index 0d7adcb..d2b2d77 100644 --- a/lib/Render/Util.rakumod +++ b/lib/Render/Util.rakumod @@ -11,7 +11,6 @@ sub show-html($html) is export { $out ~~ s:g/'' \v+ ''/<\/i>/; $out ~~ s:g/\v+ ''/<\/a>/; $out ~~ s:g/\s+ ',' \s+ ' code { padding: 0 0.25rem; + border-radius: 0.25rem; } /* Styling for fenced code blocks */