post now command
This commit is contained in:
parent
972b73f665
commit
448908c18e
4 changed files with 17 additions and 1 deletions
15
blog
15
blog
|
@ -284,6 +284,21 @@ multi MAIN(
|
||||||
$db.write: $db-dir;
|
$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
|
#| Create a new series
|
||||||
multi MAIN(
|
multi MAIN(
|
||||||
"series",
|
"series",
|
||||||
|
|
|
@ -16,6 +16,7 @@ IO::Path:D $.source
|
||||||
#| The time to display for the creation of the post
|
#| The time to display for the creation of the post
|
||||||
has
|
has
|
||||||
DateTime:D $.posted-at
|
DateTime:D $.posted-at
|
||||||
|
is rw
|
||||||
is required
|
is required
|
||||||
is json(
|
is json(
|
||||||
:to-json(*.Str),
|
:to-json(*.Str),
|
||||||
|
|
|
@ -11,7 +11,6 @@ sub show-html($html) is export {
|
||||||
$out ~~ s:g/'</i>' \v+ '<span>'/<\/i><span>/;
|
$out ~~ s:g/'</i>' \v+ '<span>'/<\/i><span>/;
|
||||||
$out ~~ s:g/\v+ '</a>'/<\/a>/;
|
$out ~~ s:g/\v+ '</a>'/<\/a>/;
|
||||||
$out ~~ s:g/\s+ ',' \s+ '<span'/, <span/;
|
$out ~~ s:g/\s+ ',' \s+ '<span'/, <span/;
|
||||||
# TODO: Deal with the nbsps in the header
|
|
||||||
$out
|
$out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ code {
|
||||||
/* Styling for inline code blocks */
|
/* Styling for inline code blocks */
|
||||||
:not(pre) > code {
|
:not(pre) > code {
|
||||||
padding: 0 0.25rem;
|
padding: 0 0.25rem;
|
||||||
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Styling for fenced code blocks */
|
/* Styling for fenced code blocks */
|
||||||
|
|
Loading…
Add table
Reference in a new issue