]> Dogcows Code - chaz/p5-Catalyst-Plugin-Sitemap/commitdiff
Merge remote branch 'ajgb/master' into www-sitemap-xml
authorYanick Champoux <yanick@babyl.dyndns.org>
Tue, 30 Nov 2010 01:53:14 +0000 (20:53 -0500)
committerYanick Champoux <yanick@babyl.dyndns.org>
Tue, 30 Nov 2010 01:53:14 +0000 (20:53 -0500)
1  2 
lib/Catalyst/Plugin/Sitemap.pm

index 7f1aee2977d83a1b3e2cbb062e6e4ef1e0cae5c3,c88be0f8a8754bbd59fc1ad47fecb42701467cff..cb579820480b1c9074115dc33ea92c83ecf21991
@@@ -35,7 -35,7 +35,7 @@@ package Catalyst::Plugin::Sitemap
      sub sitemap : Path('/sitemap') {
          my ( $self, $c ) = @_;
   
-         $c->res->body( $c->sitemap->xml );
+         $c->res->body( $c->sitemap->as_xml->sprint );
      }
  
  =head1 DESCRIPTION
@@@ -47,7 -47,7 +47,7 @@@ of the sitemap of a Catalyst applicatio
  
  =head2 sitemap()
  
- Returns a L<Search::Sitemap> object. The sitemap object is populated by 
+ Returns a L<WWW::Search::XML> object. The sitemap object is populated by 
  inspecting the controllers of the application for actions with the 
  sub attribute C<:Sitemap>.
  
@@@ -89,7 -89,8 +89,8 @@@ resolves in a single url, this will res
          ...
      }
  
- Adds the url with the given entry attributes (as defined by C<Search::Sitemap>).
+ Adds the url with the given entry attributes (as defined by
+ L<WWW::Search::XML::URL>).
  
  If the action does not
  resolves in a single url, this will results in an error.
@@@ -116,7 -117,7 +117,7 @@@ resolving to many urls
  =head1 BUGS AND LIMITATIONS
  
  Currently, each invocation of the method C<sitemap()> will 
- re-generate the C<Search::Sitemap> object.  A future version
+ re-generate the C<WWW::Sitemap::XML> object.  A future version
  of this module might offer a way to only compute the sitemap
  once.
  
  
  =over 
  
- =item L<Search::Sitemap>
+ =item L<WWW::Sitemap::XML>
  
 +Module that C<Catalyst::Plugin::Sitemap> uses under the hood.
 +
 +=item L<Dancer::Plugin::SiteMap>
 +
 +Similar plugin for the L<Dancer> framework, which inspired
 +C<Catalyst::Plugin::Sitemap>. 
 +
  =item http://babyl.dyndns.org/techblog/entry/catalyst-plugin-sitemap
  
 +Blog article introducing C<Catalyst::Plugin::Sitemap>.
 +
  =back
  
  =cut
@@@ -149,14 -141,13 +150,13 @@@ use Moose::Role
  
  no warnings qw/uninitialized/;
  
- use Search::Sitemap;
+ use WWW::Sitemap::XML;
  use List::Util qw/ first /;
  
  sub sitemap {
      my $self = shift;
  
-     my $sitemap = Search::Sitemap->new;
-     $sitemap->pretty(1);
+     my $sitemap = WWW::Sitemap::XML->new;
  
      for my $controller ( $self->controller(qr//) ) {
        ACTION:
This page took 0.027009 seconds and 4 git commands to generate.