App-Chronicle

 view release on metacpan or  search on metacpan

lib/Chronicle/Plugin/Generate/LowerCase.pm  view on Meta::CPAN

                                          mode    => oct("755"),
                                       } );
            }

            my $out =
              $config->{ 'output' } . "/" . $entry->{ 'link' }->unescaped;

            $config->{ 'verbose' } &&
              print "Writing redirection to $out for mixed-case post " .
              lc( $entry->{ 'link' } ) . "\n";


            #
            #  Clear the template, and populate it
            #
            $c->param( top    => $config->{ 'top' } );
            $c->param( target => lc( $entry->{ 'link' } ) );

            #
            # Write it out
            #
            open( my $handle, ">:encoding(UTF-8)", $out ) or
              die "Failed to open `$out' for writing: $!";
            print $handle $c->output();
            close($handle);


        }
    }

    $all->finish();
}

1;


=head1 LICENSE

This module is free software; you can redistribute it and/or modify it
under the terms of either:

a) the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version,
or

b) the Perl "Artistic License".

=cut

=head1 AUTHOR

Steve Kemp <steve@steve.org.uk>

=cut

__DATA__
<!DOCTYPE html>
 <html lang="en">
 <head>
  <title>Blog Post Moved</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="refresh" content="0; url=<!-- tmpl_var name='top' --><!-- tmpl_var name='target' -->">
  <link rel="canonical" href="<!-- tmpl_var name='top' --><!-- tmpl_var name='target' -->">
 </head>
 <body>
  <h1>Post Moved</h1>
  <p>Please find the post here:</p>
  <ul>
   <li><a href="<!-- tmpl_var name='top' --><!-- tmpl_var name='target' -->"><!-- tmpl_var name='top' --><!-- tmpl_var name='target' --></a></li>
  </ul>
 </body>
</html>



( run in 1.375 second using v1.01-cache-2.11-cpan-437f7b0c052 )