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; meta :name, :content; meta :author :content; 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 :href; link :rel :href; link :rel :href :crossorigin; link :rel :href; # Load fonts, Iosevka for code, Open Sans for content, and boxicons for # icons link :rel, :href; link :rel, :href; link :rel, :href; # Link our style sheets link :rel, :href; link :rel, :href; link :rel, :href; ] }