Setup footer
This commit is contained in:
parent
63e581ac03
commit
3069e480a4
7 changed files with 163 additions and 9 deletions
|
@ -5,6 +5,7 @@ use HTML::Functional;
|
|||
use Render::Util;
|
||||
use Render::Head;
|
||||
use Render::Post;
|
||||
use Render::Foot;
|
||||
use DB::BlogMeta;
|
||||
use DB::Post;
|
||||
|
||||
|
@ -57,10 +58,8 @@ initComments(\{
|
|||
];
|
||||
# Only actually have the comment section if the post isn't hidden
|
||||
optl !$post.hidden, -> {div :id<comment-section>, :class<comments>};
|
||||
generate-footer;
|
||||
];
|
||||
# TODO: Setup Comments
|
||||
# TODO: Setup footer
|
||||
# my $footer;
|
||||
|
||||
my $html = html :lang<en>, [
|
||||
$head,
|
||||
|
@ -85,6 +84,7 @@ method generate-index($db) {
|
|||
div :class<post-blurbs>, [
|
||||
h1 "Recent Posts"
|
||||
], @most-recent;
|
||||
generate-footer;
|
||||
];
|
||||
|
||||
my $html =
|
||||
|
@ -110,6 +110,7 @@ method generate-archive($db) {
|
|||
div :class<post-blurbs>, [
|
||||
h1 "All Posts"
|
||||
], @most-recent;
|
||||
generate-footer;
|
||||
];
|
||||
|
||||
my $html =
|
||||
|
@ -168,6 +169,7 @@ method generate-tags-page($db, @tags) {
|
|||
div :class<tags>, [
|
||||
h1 "Tags";
|
||||
], @tags.map(-> $tag {self.generate-tag-blurb($db, $tag, 4)});
|
||||
generate-footer;
|
||||
];
|
||||
|
||||
my $html =
|
||||
|
@ -184,6 +186,7 @@ method generate-tag-page($db, $tag) {
|
|||
my $body = body [
|
||||
site-header $db.meta;
|
||||
self.generate-tag-blurb($db, $tag, 4);
|
||||
generate-footer;
|
||||
];
|
||||
|
||||
my $html =
|
||||
|
|
69
lib/Render/Foot.rakumod
Normal file
69
lib/Render/Foot.rakumod
Normal file
|
@ -0,0 +1,69 @@
|
|||
use v6.e.PREVIEW;
|
||||
unit module Render::Foot;
|
||||
|
||||
use HTML::Functional;
|
||||
|
||||
use Render::Util;
|
||||
use DB::BlogMeta;
|
||||
|
||||
sub footer-link($name, $title, $path, $icon) {
|
||||
div :class<footer-link>, [
|
||||
$icon;
|
||||
a :href($path), :title($title), [
|
||||
$name;
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
sub generate-footer() is export {
|
||||
footer [
|
||||
div :class<contact>, [
|
||||
div :class<footer-title>, span "Contact Me";
|
||||
div :class<footer-links>, [
|
||||
footer-link (^ "@thatonelutenist"),
|
||||
"Discord",
|
||||
"https://discordapp.com/users/thatonelutenist",
|
||||
simple-icon "discord";
|
||||
footer-link (^ "@thatonelutenist:stranger.systems"),
|
||||
"Matrix",
|
||||
"https://matrix.to/#/@thatonelutenist:stranger.systems",
|
||||
simple-icon "matrix";
|
||||
footer-link (^ "~thatonelutenist/public-inbox@lists.sr.ht"),
|
||||
"Email",
|
||||
"mailto:~thatonelutenist/public-inbox@lists.sr.ht",
|
||||
icon-solid "envelope";
|
||||
];
|
||||
];
|
||||
div :class<code>, [
|
||||
div :class<footer-title>, span "Find My Code";
|
||||
div :class<footer-links>, [
|
||||
footer-link "git.stranger.systems",
|
||||
"Stranger Systems Forgejo",
|
||||
"https://git.stranger.systems/explore/repos",
|
||||
simple-icon "forgejo";
|
||||
footer-link (^ "~thatonelutenist"),
|
||||
"sr.ht",
|
||||
"https://sr.ht/~thatonelutenist/",
|
||||
simple-icon "sourcehut";
|
||||
footer-link (^ "@nmccarty"),
|
||||
"Github",
|
||||
"https://github.com/nmccarty",
|
||||
simple-icon "github";
|
||||
footer-link (^ "@thatonelutenist"),
|
||||
"Gitlab",
|
||||
"https://gitlab.com/thatonelutenist",
|
||||
simple-icon "gitlab";
|
||||
];
|
||||
];
|
||||
div :class<socials>, [
|
||||
div :class<footer-title>, span "Social Media";
|
||||
div :class<footer-links>, [
|
||||
footer-link "@thatonelutenist@hachyderm.io",
|
||||
"Mastodon",
|
||||
"https://hachyderm.io/@thatonelutenist",
|
||||
simple-icon "mastodon";
|
||||
];
|
||||
]
|
||||
]
|
||||
}
|
||||
|
|
@ -41,11 +41,14 @@ sub generate-head(BlogMeta:D $meta, $title?, $description?) is export {
|
|||
:href</resources/code.css>;
|
||||
link :rel<stylesheet>,
|
||||
:href</resources/admonitions.css>;
|
||||
|
||||
# Verify mastodon
|
||||
link :rel<me>, :href<https://hachyderm.io/@thatonelutenist>;
|
||||
# Tell dark reader that we'll behave
|
||||
meta :name<color-scheme>, :content<light dark>;
|
||||
# Tell feed readers about our feed
|
||||
link :rel<alternate>, :type<application/atom+xml>, :title($meta.title),
|
||||
:href</feed.xml>;
|
||||
:href</atom.xml>;
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ unit module Render::Series;
|
|||
|
||||
use Render::Util;
|
||||
use Render::Head;
|
||||
use Render::Foot;
|
||||
use Render::Post;
|
||||
use DB::Post;
|
||||
use DB::Series;
|
||||
|
@ -93,7 +94,8 @@ sub series-page(Int:D $series-id, $db) is export {
|
|||
series-header $series, $db;
|
||||
div :class<series-blurbs>,
|
||||
$series.post-ids.map(*.&generate-blurb($db));
|
||||
]
|
||||
];
|
||||
generate-footer;
|
||||
];
|
||||
|
||||
my $html = html :lang<en>, [
|
||||
|
|
|
@ -49,10 +49,18 @@ sub icon($icon) is export {
|
|||
i(:class("bx bx-$icon"))
|
||||
}
|
||||
|
||||
sub icon-solid($icon) is export {
|
||||
i(:class("bx bxs-$icon"))
|
||||
}
|
||||
|
||||
sub logo($logo) is export {
|
||||
i(:class("bx bxl-$logo"))
|
||||
}
|
||||
|
||||
sub simple-icon($icon) is export {
|
||||
img :src("https://cdn.simpleicons.org/$icon/474747/b9b9b9")
|
||||
}
|
||||
|
||||
sub mins-to-string($mins) is export {
|
||||
if $mins < 60 {
|
||||
$mins.Str ~ "m"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue