sitemap: prefer https protocol for absolute site references
[sheet.git] / tools / mksitemap
index abfd8d09f549a8648506507b4b162e2c206108ef..cbffc0beb45e3313321c00dac0a42c8e40f5c857 100755 (executable)
@@ -2,7 +2,7 @@
 use 5.014;
 use warnings;
 
-our $VERSION = '1.02';
+our $VERSION = '1.03';
 
 use File::stat;
 use Time::Piece;
@@ -19,7 +19,8 @@ my @pages = (
        [qw(
                apl less screen digits sc/bw sc/hots termcol/legacy mplayer
                keyboard/altgr/macos-abc keyboard/altgr/msx keyboard/altgr/ukext
-               keyboard/altgr/eurkey keyboard/altgr/apl
+               keyboard/altgr/eurkey keyboard/altgr/apl keyboard/altgr/spacecadet
+               keyboard/altgr/ipa
        )],
        [qw( chars/table/html sample source plan )],
 );
@@ -39,15 +40,20 @@ for my $group (@pages) {
        state $prio = 1;
        for my $file (@{$group}) {
                (my $page = $file) =~ s/\Aindex\z//;
-               $file =~ s{/.*}{};
-               $file .= '.plp';
+               if (-e "$file.eng.inc.pl") {
+                       $file .= '.eng.inc.pl';
+               }
+               else {
+                       $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>";
+               print "<loc>https://sheet.shiar.nl/$page</loc>";
                printf '<changefreq>%s</changefreq>', $freq{$page} // 'monthly';
                printf '<priority>%.2f</priority>', $prio;
                printf '<lastmod>%s</lastmod>', localtime($stat->mtime)->date;