42 lines
1.6 KiB
Raku
42 lines
1.6 KiB
Raku
use v6.e.PREVIEW;
|
|
unit module Render::Head;
|
|
|
|
use HTML::Functional;
|
|
|
|
use Render::Util;
|
|
use DB::BlogMeta;
|
|
|
|
sub generate-head(BlogMeta:D $meta, $title?, $description?) is export {
|
|
head [
|
|
meta :charset<utf-8>;
|
|
meta :name<viewport>, :content<width=device-width, initial-scale=1>;
|
|
meta :author :content<Nathan McCarty>;
|
|
do if $title ~~ Str:D {
|
|
title "$title — {$meta.title}";
|
|
} else {
|
|
title $meta.title;
|
|
}
|
|
# Add description, if one exists
|
|
optl $description ~~ Str:D, -> {meta :description :content($description)};
|
|
# Preconnect to all our resource sources
|
|
link :rel<preconnect> :href<https://static.stranger.systems>;
|
|
link :rel<preconnect> :href<https://fonts.googleapis.com>;
|
|
link :rel<preconnect> :href<https://fonts.gstatic.com> :crossorigin;
|
|
link :rel<preconnect> :href<https://unpkg.com>;
|
|
# Load fonts, Iosevka for code, Open Sans for content, and boxicons for
|
|
# icons
|
|
link :rel<stylesheet>,
|
|
:href<https://static.stranger.systems/fonts/Iosevka/Iosevka.css>;
|
|
link :rel<stylesheet>,
|
|
:href<https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap>;
|
|
link :rel<stylesheet>,
|
|
:href<https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css>;
|
|
# Link our style sheets
|
|
link :rel<stylesheet>,
|
|
:href</resources/colors.css>;
|
|
link :rel<stylesheet>,
|
|
:href</resources/main.css>;
|
|
link :rel<stylesheet>,
|
|
:href</resources/code.css>;
|
|
]
|
|
}
|