post now command

This commit is contained in:
Nathan McCarty 2025-02-09 18:09:06 -05:00
parent 972b73f665
commit 448908c18e
4 changed files with 17 additions and 1 deletions

15
blog
View file

@ -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",

View file

@ -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),

View file

@ -11,7 +11,6 @@ sub show-html($html) is export {
$out ~~ s:g/'</i>' \v+ '<span>'/<\/i><span>/;
$out ~~ s:g/\v+ '</a>'/<\/a>/;
$out ~~ s:g/\s+ ',' \s+ '<span'/, <span/;
# TODO: Deal with the nbsps in the header
$out
}

View file

@ -6,6 +6,7 @@ code {
/* Styling for inline code blocks */
:not(pre) > code {
padding: 0 0.25rem;
border-radius: 0.25rem;
}
/* Styling for fenced code blocks */