Skip to content

Instantly share code, notes, and snippets.

@maspalio
Created September 9, 2015 11:31
Show Gist options
  • Save maspalio/e8e0ce68587231a8ad38 to your computer and use it in GitHub Desktop.
Save maspalio/e8e0ce68587231a8ad38 to your computer and use it in GitHub Desktop.
Static web site from Dancer via Wallflower
#!/usr/bin/env perl
use Dancer;
use File::Copy;
use Wallflower;
use My::App;
my $app = sub {
my $env = shift;
my $request = Dancer::Request->new ( env => $env );
Dancer->dance ( $request );
};
my $wf = Wallflower->new ( application => $app, destination => 'static' );
$wf->get( $_ ) for qw( /sitemap /sitemap.xml / ), map { "/$_.html" } qw( page1 page2 ... );
rename 'static/sitemap' => 'static/sitemap.html';
copy ( "public/images/favicon.ico", "static/favicon.ico" ) or die "Copy failed: $!";
print "# lighttpd -D -f static/lighttpd.conf\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment