Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improve dist.ini; renderer root as root for static files instead of h…

…ardcoded path
  • Loading branch information...
commit 7fa0bddeb9f15a48a81a1bd0854de352518a74ea 1 parent 400ad1e
Zbigniew Lukasiak authored
Showing with 43 additions and 10 deletions.
  1. +2 −0  README
  2. +24 −2 dist.ini
  3. +17 −8 lib/Nblog.pm
View
2  README
@@ -2,3 +2,5 @@ This is rewrite of RavLog by Gerda Shank replacing Catalyst with WebNano.
The current revision requires latest WebNano from github.
+To create a CPAN-ready distribution file remove this README and run 'dzil build'.
+
View
26 dist.ini
@@ -1,7 +1,29 @@
name = Nblog
author = Zbigniew Lukasiak <zby@cpan.org>
-author = Gerda Shank
-license = Perl_5
+license = Artistic_2_0
copyright_holder = Zbigniew Lukasiak <zby@cpan.org>
copyright_year = 2010
+version = 0.001
+[@Basic]
+[AutoPrereqs]
+[Prereqs]
+[TestRelease]
+[PkgVersion]
+
+[MetaNoIndex]
+directory = t/lib
+directory = examples
+directory = extensions
+[MetaJSON]
+[MetaResources]
+repository.web = http://github.com/zby/Nblog
+repository.type = git
+
+[NextRelease]
+format = %-9v %{yyyy-MM-dd}d
+[CheckChangeLog]
+[PodSyntaxTests]
+[PodCoverageTests]
+[KwaliteeTests]
+[PodWeaver]
View
25 lib/Nblog.pm
@@ -178,15 +178,24 @@ sub pages {
}
-override psgi_callback => sub {
- my $app = super;
- $app = Plack::Middleware::Static->wrap( $app, path => qr{^/static/}, root => './templates/' );
- $app = Plack::Middleware::Static->wrap( $app, path => qr{^/favicon.ico$}, root => './templates/static/images/' );
- $app = Plack::Middleware::Session->wrap( $app, store => Plack::Session::Store::Cache->new(
- cache => CHI->new(driver => 'FastMmap')
- )
- );
+around psgi_callback => sub {
+ my $orig = shift;
+ my $self = shift;
+ my $app = $self->$orig( @_ );
+ for my $root ( @{ $self->renderer->global_path } ){
+ $app = Plack::Middleware::Static->wrap( $app, path => qr{^/static/}, root => $root );
+ $app = Plack::Middleware::Static->wrap( $app, path => qr{^/favicon.ico$}, root => "$root/static/images/" );
+ $app = Plack::Middleware::Session->wrap( $app, store => Plack::Session::Store::Cache->new(
+ cache => CHI->new(driver => 'FastMmap')
+ )
+ );
+ }
return $app;
};
1;
+
+__END__
+
+# ABSTRACT: A simple blog engine
+
Please sign in to comment.
Something went wrong with that request. Please try again.