Factor out and clean up site-header

This commit is contained in:
Nathan McCarty 2025-02-07 02:44:35 -05:00
parent 72bd2a238c
commit 87e18dbf60
3 changed files with 37 additions and 58 deletions

View file

@ -40,3 +40,29 @@ sub generate-head(BlogMeta:D $meta, $title?, $description?) is export {
:href</resources/code.css>;
]
}
sub site-header(BlogMeta:D $meta) is export {
sub header-link($name, $path, $icon) {
a :href("$path"), [
icon $icon;
'&nbsp;';
span $name;
]
}
header :class<site-header>, [
div :class<site-logo>, [
# TODO: Use a real image here
$meta.title
];
div :class<site-tagline>, [
$meta.tagline
];
div :class<header-links>, [
header-link 'Index', '/index.html', 'home';
header-link 'Archive', '/archive.html', 'archive';
header-link 'Tags', '/tags.html', 'purchase-tag-alt';
header-link 'About', '/about.html', 'info-circle';
header-link 'Feed', '/atom.xml', 'rss';
];
]
}