sitemap: export subpages added in v1.16
[sheet.git] / tools / mksitemap
index 8b16f6fdcd3aa0e342738485aea0ed58039a4ed9..2fd6ee085b052707fa12109fa0516055cca423c0 100755 (executable)
@@ -2,18 +2,24 @@
 use 5.014;
 use warnings;
 
-our $VERSION = '1.00';
+our $VERSION = '1.02';
 
 use File::stat;
 use Time::Piece;
 
 my @pages = (
        [qw( index )],
-       [qw( vi digraphs charset browser writing sc/2 termcol )],
+       [qw( vi digraphs charset browser writing sc/lotv termcol dieren )],
        [qw( readline latin unicode countries emoji perl )],
-       [qw( vimperator mutt nethack mplayer font )],
-       [qw( apl less screen brahmi digits sc termcol/legacy )],
-       [qw( chars/table/html source )],
+       [qw(
+               vimperator mutt nethack mplayer/mpv font codec
+               keyboard/altgr/windows keyboard/altgr/macos
+               dieren/uitgebreid dieren/beknopt
+       )],
+       [qw(
+               apl less screen digits sc/bw sc/hots termcol/legacy mplayer
+       )],
+       [qw( chars/table/html sample source plan )],
 );
 
 my %freq = (
@@ -33,11 +39,16 @@ for my $group (@pages) {
                (my $page = $file) =~ s/\Aindex\z//;
                $file =~ s{/.*}{};
                $file .= '.plp';
+               my $stat = stat $file or do {
+                       warn "missing file $file\n";
+                       next;
+               };
+
                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;
+               printf '<lastmod>%s</lastmod>', localtime($stat->mtime)->date;
                say '</url>';
        }
        $prio -= .1;