Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add runtime middleware, fix markup

  • Loading branch information...
commit 10eb009e662b9db8bb2de137e29c5fb64c43f924 1 parent a97c43a
@nobuo-danjou nobuo-danjou authored
Showing with 6 additions and 6 deletions.
  1. +3 −3 app.p6sgi
  2. +3 −3 lib/Formatter.pm
View
6 app.p6sgi
@@ -1,6 +1,7 @@
use v6;
use Journal;
use Plackdo::Builder;
+use Plackdo::Middleware::Runtime;
use Plackdo::Middleware::Static;
my $conf = eval slurp 'config.pl';
@@ -9,9 +10,8 @@ $conf or die 'invalid config';
my $j = Journal.new(|$conf<database>);
my $b = Plackdo::Builder.new;
-$b.add_middleware(
- Plackdo::Middleware::Static.new(|$conf<static>)
-);
+$b.add_middleware( Plackdo::Middleware::Runtime.new );
+$b.add_middleware( Plackdo::Middleware::Static.new(|$conf<static>) );
$b.to_app($j.webapp);
# vim: ft=perl6
View
6 lib/Formatter.pm
@@ -10,7 +10,7 @@ module Formatter {
our sub body(*@str) is export { tag('body', {}, @str) }
our sub link(%attr) is export { tag('link', %attr) }
sub title(*@str) is export { tag('title', {}, @str) }
- sub meta(%attr) is export { tag('meta', %attr, '') }
+ sub meta(%attr) is export { tag('meta', %attr) }
sub tag($tagname, %attr?, *@str) {
my $ret = "<$tagname";
@@ -18,9 +18,9 @@ module Formatter {
$ret ~= ' ' ~ $p.key ~ '="' ~ $p.value ~ '"';
}
if (+@str) {
- $ret ~= '>' ~ [~]@str ~ "</$tagname>";
+ $ret ~= '>' ~ [~]@str ~ "</$tagname>\n";
} else {
- $ret ~= ' />';
+ $ret ~= " />\n";
}
return $ret;
}
Please sign in to comment.
Something went wrong with that request. Please try again.