our $VERSION = '1.00';
+use File::stat;
+use Time::Piece;
+
my @pages = (
[qw( index )],
[qw( readline vi digraphs charset unicode )],
say '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
for my $group (@pages) {
state $prio = 1;
- for my $page (@{$group}) {
- $page =~ s/\Aindex\z//;
+ for my $file (@{$group}) {
+ (my $page = $file) =~ s/\Aindex\z//;
+ $file .= '.plp';
print '<url>';
print "<loc>http://sheet.shiar.nl/$page</loc>";
printf '<changefreq>%s</changefreq>', $freq{$page} // 'monthly';
printf '<priority>%.2f</priority>', $prio;
+ printf '<lastmod>%s</lastmod>', localtime(stat($file)->mtime)->date;
say '</url>';
}
$prio -= .1;