Skip to content

Commit

Permalink
calculate sitemap dir rather than hard coding
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Oct 29, 2014
1 parent 70731bd commit c675627
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bin/generate_sitemap.pl
Expand Up @@ -10,16 +10,18 @@

use MetaCPAN::Sitemap;

my $out_dir = "$Bin/../root/static/sitemaps/";
mkdir $out_dir;

my @parts = (

# For authors, we're looking for the pauseid, and want to build a URL
# with 'author' in the path.

{
object_type => 'author',
field_name => 'pauseid',
xml_file =>
'/home/metacpan/metacpan-web/root/static/sitemaps/authors.xml.gz',
object_type => 'author',
field_name => 'pauseid',
xml_file => "$out_dir/authors.xml.gz",
cpan_directory => 'author',
},

Expand All @@ -28,10 +30,9 @@
# filter on only the 'latest' entries.

{
object_type => 'release',
field_name => 'distribution',
xml_file =>
'/home/metacpan/metacpan-web/root/static/sitemaps/releases.xml.gz',
object_type => 'release',
field_name => 'distribution',
xml_file => "$out_dir/releases.xml.gz",
cpan_directory => 'release',
filter => { status => 'latest' },
}
Expand Down

0 comments on commit c675627

Please sign in to comment.