Header link support

This commit is contained in:
Nathan McCarty 2025-03-15 17:56:00 -04:00
parent 51e50cd0d6
commit a2a811aa4a
7 changed files with 36 additions and 3 deletions

25
blog
View file

@ -3,6 +3,7 @@ use v6.e.PREVIEW;
use DB;
use DB::BlogMeta;
use DB::HeaderLink;
use DB::Series;
use DB::MarkdownPost;
use DB::IdrisPost;
@ -418,6 +419,30 @@ multi MAIN(
$db.write: $db-dir;
}
#| Add a header link
multi MAIN(
"header-link",
"add",
#| The path of the database directory
IO::Path(Str) :$db-dir = $default-db-dir,
) {
my $db = read-db $db-dir;
print "Link Text: ";
my $text = get;
print "Link Location: ";
my $link = get;
print "Icon: ";
my $icon = get;
my $header-link =
HeaderLink.new:
text => $text, link => $link, icon => $icon;
$db.meta.header-links.push: $header-link;
$db.write: $db-dir;
}
#| Do a clean build and upload the blog to the remote
multi MAIN(
"upload",