Add post source code tag
This commit is contained in:
parent
f887be396b
commit
dcc6799e6f
5 changed files with 46 additions and 4 deletions
28
blog
28
blog
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue