render markdown
This commit is contained in:
parent
815ff4bf4e
commit
addce4f87c
2 changed files with 13 additions and 8 deletions
|
@ -10,14 +10,20 @@ method generate-post(Str:D $title, Str:D $content, BlogMeta:D $meta) {
|
||||||
head [
|
head [
|
||||||
meta :charset<utf-8>;
|
meta :charset<utf-8>;
|
||||||
meta :name<viewport>, :content<width=device-width, initial-scale=1>;
|
meta :name<viewport>, :content<width=device-width, initial-scale=1>;
|
||||||
# meta :name<description>, :content<raku does htmx>;
|
title "{$meta.title} — $title";
|
||||||
title "";
|
# TODO: Add style sheets
|
||||||
|
# TODO: Add description
|
||||||
|
# TODO: Add header links
|
||||||
];
|
];
|
||||||
my $body;
|
my $body =
|
||||||
|
body [
|
||||||
|
div :class<post-body>, [
|
||||||
|
$content
|
||||||
|
]
|
||||||
|
];
|
||||||
|
# TODO: Setup footer
|
||||||
# my $footer;
|
# my $footer;
|
||||||
|
|
||||||
die "Not done yet";
|
|
||||||
|
|
||||||
my $html = html :lang<en>, [
|
my $html = html :lang<en>, [
|
||||||
$head,
|
$head,
|
||||||
$body
|
$body
|
||||||
|
|
|
@ -2,7 +2,6 @@ use v6.e.PREVIEW;
|
||||||
|
|
||||||
use Pandoc;
|
use Pandoc;
|
||||||
use JSON::Class:auth<zef:vrurg>;
|
use JSON::Class:auth<zef:vrurg>;
|
||||||
|
|
||||||
use DB::Post;
|
use DB::Post;
|
||||||
|
|
||||||
#| A plain markdown post
|
#| A plain markdown post
|
||||||
|
@ -13,10 +12,10 @@ unit class MarkdownPost does Post is json(:pretty);
|
||||||
has Bool:D $.markdown = True;
|
has Bool:D $.markdown = True;
|
||||||
|
|
||||||
method title(--> Str:D) {
|
method title(--> Str:D) {
|
||||||
markdown-title($!source)
|
markdown-title $!source
|
||||||
}
|
}
|
||||||
|
|
||||||
# Simply provide our source file to pandoc
|
# Simply provide our source file to pandoc
|
||||||
method render-html(--> Str:D) {
|
method render-html(--> Str:D) {
|
||||||
die "Not implemented";
|
markdown-to-html $!source
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue