Add post source code tag

This commit is contained in:
Nathan McCarty 2025-02-10 12:27:05 -05:00
parent f887be396b
commit dcc6799e6f
5 changed files with 46 additions and 4 deletions

28
blog
View file

@ -204,7 +204,7 @@ multi MAIN(
multi MAIN(
"post",
"info",
#| The id of the post to display information for
#| The id of the post
Int $id,
#| The path of the database directory
IO::Path(Str) :$db-dir = $default-db-dir,
@ -260,7 +260,7 @@ multi MAIN(
multi MAIN(
"post",
"tag",
#| The id of the post to display information for
#| The id of the post
Int $id,
#| The tag to add/remove
Str $tag,
@ -288,7 +288,7 @@ multi MAIN(
multi MAIN(
"post",
"now",
#| The id of the post to update the posted-at time
#| The id of the post
Int $id,
#| The path of the database directory
IO::Path(Str) :$db-dir = $default-db-dir,
@ -299,6 +299,26 @@ multi MAIN(
$db.write: $db-dir;
}
#| Set the source code link for a post
multi MAIN(
"post",
"source",
#| The id of the post
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};
say "Source Code Link:";
my $source-code = get;
$post.source-code = $source-code;
$db.write: $db-dir;
}
#| Create a new series
multi MAIN(
"series",
@ -387,7 +407,7 @@ multi MAIN(
"add",
#| The id of the series to add to
Int $series-id,
#| The id of the post to add
#| The id of the post
Int $post-id,
#| The path of the database directory
IO::Path(Str) :$db-dir = $default-db-dir,