Skip to content

Commit 7f983d3

Browse files
committed
Handle images, html header
1 parent 9111941 commit 7f983d3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

util/site

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,23 @@ my $application = route {
2020
get -> '' {
2121
content 'text/plain', "It's the home page"
2222
}
23+
# Simple pod to HTML conversion
2324
for <language programs type> -> $section {
2425
get -> $section, $path {
2526
content 'text/html', pod-to-html("doc/{tc $section}/{$path}.pod6")
2627
}
2728
}
29+
# Raw files
30+
get -> 'images', $image {
31+
content 'image/svg+xml', "html/images/{$image}".IO.slurp
32+
}
2833
}
2934

3035
# Helper routines
36+
my $template-header = "template/header.html".IO.slurp;
37+
3138
sub pod-to-html($file) {
32-
Pod::To::HTML.render($file.IO);
39+
Pod::To::HTML.render($file.IO, :header($template-header));
3340
}
3441

3542
my Cro::Service $hello = Cro::HTTP::Server.new:

0 commit comments

Comments
 (0)