From e19a959d150b4cfee644f1a29ada1d05c826f207 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 3 May 2017 00:02:15 +0200 Subject: [PATCH] sitemap: include file dates in lastmod attribute --- tools/mksitemap | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/mksitemap b/tools/mksitemap index 4948525..7b9c5a0 100755 --- a/tools/mksitemap +++ b/tools/mksitemap @@ -4,6 +4,9 @@ use warnings; our $VERSION = '1.00'; +use File::stat; +use Time::Piece; + my @pages = ( [qw( index )], [qw( readline vi digraphs charset unicode )], @@ -24,12 +27,14 @@ say ''; say ''; 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 ''; print "http://sheet.shiar.nl/$page"; printf '%s', $freq{$page} // 'monthly'; printf '%.2f', $prio; + printf '%s', localtime(stat($file)->mtime)->date; say ''; } $prio -= .1; -- 2.30.0