From c0f5d2bd437dc554f08beaf3ad3ac3d836ca7656 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 2 May 2017 23:55:49 +0200 Subject: [PATCH] sitemap: tool to generate static xml Effectively the same results but easier to maintain. --- .gitignore | 3 +++ Makefile | 5 +++- sitemap.xml | 63 ------------------------------------------------- tools/mksitemap | 33 ++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 64 deletions(-) delete mode 100644 sitemap.xml create mode 100755 tools/mksitemap diff --git a/.gitignore b/.gitignore index 89c1555..bec2de1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # downloaded data and generated includes /data +# derived contents +/sitemap.xml + # site owner tag for google webmaster tools /google????????????????.html diff --git a/Makefile b/Makefile index 0c50b05..8e644e8 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ -all: data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl +all: sitemap.xml data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl more: all data/digraphs-xorg.inc.pl download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv data/xcolors .PHONY: download +sitemap.xml: tools/mksitemap + $< >$@ + data/DerivedAge.txt: tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@ diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index 2a70777..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - http://sheet.shiar.nl/ - monthly - 1.00 - - - http://sheet.shiar.nl/readline - yearly - 0.80 - - - http://sheet.shiar.nl/vi - monthly - 0.80 - - - http://sheet.shiar.nl/vimperator - monthly - 0.70 - - - http://sheet.shiar.nl/mutt - monthly - 0.70 - - - http://sheet.shiar.nl/nethack - yearly - 0.70 - - - http://sheet.shiar.nl/mplayer - yearly - 0.70 - - - http://sheet.shiar.nl/digraphs - monthly - 0.80 - - - http://sheet.shiar.nl/charset - monthly - 0.80 - - - http://sheet.shiar.nl/unicode - monthly - 0.80 - - - http://sheet.shiar.nl/source - monthly - 0.60 - - - http://sheet.shiar.nl/writing - monthly - 0.75 - - diff --git a/tools/mksitemap b/tools/mksitemap new file mode 100755 index 0000000..cbfa8c9 --- /dev/null +++ b/tools/mksitemap @@ -0,0 +1,33 @@ +#!/usr/bin/env perl +use 5.014; +use warnings; + +our $VERSION = '1.00'; + +my @pages = ( + [''], + [qw( readline vi digraphs charset unicode )], + [qw( vimperator mutt nethack mplayer )], + [qw( writing )], + [qw( source )], +); + +my %freq = ( + (map { $_ => 'yearly' } qw[ readline nethack mplayer ]), +); + +say ''; +say ''; +for my $group (@pages) { + state $prio = 1; + for my $page (@{$group}) { + print ''; + print "http://sheet.shiar.nl/$page"; + printf '%s', $freq{$page} // 'monthly'; + printf '%.2f', $prio; + say ''; + } + $prio -= .1; +} +say ''; + -- 2.30.0