| 1 | package Search::Sitemap::Index; | ||
| 2 | $Search::Sitemap::Index::VERSION = '2.13_01'; | ||
| 3 | 1 | ▶ | use 5.008003; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | our $AUTHORITY = 'cpan:JASONK'; | ||
| 7 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | extends 'Search::Sitemap'; | ||
| 9 | 1 | ▶ | use MooseX::ClassAttribute; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use MooseX::Types::Moose qw( ArrayRef ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use Search::Sitemap::Types qw( SitemapURL XMLPrettyPrintValue ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 1 | ▶ | use namespace::clean -except => 'meta'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | class_has '+base_element' => ( default => 'sitemapindex' ); | ||
| 15 | class_has '+url_type' => ( default => 'sitemap' ); | ||
| 16 | class_has '+url_fields' => ( default => sub { [qw( loc lastmod )] } ); | ||
| 17 | |||
| 18 | around '_build_xml_headers' => sub { | ||
| 19 | my $next = shift; | ||
| 20 | my $headers = $next->( @_ ); | ||
| 21 | $headers->{ 'xsi:schemaLocation' } =~ s/sitemap\.xsd$/siteindex.xsd/; | ||
| 22 | return $headers; | ||
| 23 | }; | ||
| 24 | |||
| 25 | __PACKAGE__->meta->make_immutable; | ||
| 26 | 1; | ||
| 27 | __END__ | ||