website/lib/Config.rakumod

34 lines
662 B
Raku
Raw Normal View History

2025-02-03 21:36:07 -05:00
use v6.e.PREVIEW;
use HTML::Functional;
use DB::BlogMeta;
unit class Config;
method generate-post(Str:D $title, Str:D $content, BlogMeta:D $meta) {
my $head =
head [
meta :charset<utf-8>;
meta :name<viewport>, :content<width=device-width, initial-scale=1>;
2025-02-03 21:51:09 -05:00
title "{$meta.title} $title";
# TODO: Add style sheets
# TODO: Add description
# TODO: Add header links
2025-02-03 21:36:07 -05:00
];
2025-02-03 21:51:09 -05:00
my $body =
body [
div :class<post-body>, [
$content
]
];
# TODO: Setup footer
2025-02-03 21:36:07 -05:00
# my $footer;
my $html = html :lang<en>, [
$head,
$body
];
"<!doctype html>$html"
}