X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/040b34c73c69215ef3a93a474fd46cae3a622033..7dcd95ca1bc9fb7330103791695eec05085d67af:/tools/mksitemap diff --git a/tools/mksitemap b/tools/mksitemap index 4948525..0b4a734 100755 --- a/tools/mksitemap +++ b/tools/mksitemap @@ -2,21 +2,37 @@ use 5.014; use warnings; -our $VERSION = '1.00'; +our $VERSION = '1.04'; + +use File::stat; +use Time::Piece; my @pages = ( [qw( index )], - [qw( readline vi digraphs charset unicode )], - [qw( vimperator mutt nethack mplayer )], - [qw( writing )], - [qw( source )], + [qw( vi digraphs charset browser writing sc/lotv termcol dieren )], + [qw( readline latin unicode countries emoji perl keyboard/altgr )], + [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 + digraphs/xorg + keyboard/altgr/macos-abc keyboard/altgr/msx keyboard/altgr/ukext + keyboard/altgr/eurkey keyboard/altgr/apl keyboard/altgr/spacecadet + keyboard/altgr/ipa keyboard/altgr/boyeg keyboard/altgr/drix + keyboard/altgr/symbolics keyboard/altgr/msx-graph + )], + [qw( chars/table/html sample source plan )], ); my %freq = ( - (map { $_ => 'yearly' } qw[ readline nethack mplayer ]), + (map { $_ => 'yearly' } qw[ readline nethack mplayer apl ]), + (map { $_ => 'weekly' } qw[ browser ]), ); -my %known = map { $_ => 1 } map { @{$_} } @pages; +my %known = map { s{/.*}{}r => 1 } map { @{$_} } @pages; $known{$_} or warn "page $_ undeclared\n" for grep { !/\./ } map { s/\.plp\z//r } glob '*.plp'; @@ -24,12 +40,25 @@ 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//; + 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 ''; - print "http://sheet.shiar.nl/$page"; + print "https://sheet.shiar.nl/$page"; printf '%s', $freq{$page} // 'monthly'; printf '%.2f', $prio; + printf '%s', localtime($stat->mtime)->date; say ''; } $prio -= .1;