diff options
| author | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:16:07 +0200 |
|---|---|---|
| committer | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:16:07 +0200 |
| commit | 57a3c1b0b14fb07891ab9f583d4c40365073faf8 (patch) | |
| tree | 56ef078306dd057c772aee17125fc41be0e4031c /sitemap.buetow.org/content/sitemap.inc.pl | |
| parent | 15897cd1907de12e14477f38547f0b5eb6f7effd (diff) | |
| parent | 7901f41e1b0ebc36d46ca725fb807038aee88fd0 (diff) | |
Merge
Diffstat (limited to 'sitemap.buetow.org/content/sitemap.inc.pl')
| -rw-r--r-- | sitemap.buetow.org/content/sitemap.inc.pl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sitemap.buetow.org/content/sitemap.inc.pl b/sitemap.buetow.org/content/sitemap.inc.pl new file mode 100644 index 0000000..6b08b82 --- /dev/null +++ b/sitemap.buetow.org/content/sitemap.inc.pl @@ -0,0 +1,33 @@ +my $hostroot = $config->get_hostroot(); + +sub space () { " " x 10 } +sub nl () { "<br />\n" } + +sub list (*) { + my $tag = shift; + my @homepages = sort `find $hostroot -name $tag`; + my @ret = (); + + for my $homepage (sort @homepages) { + my ($host) = $homepage =~ /.*hosts.(.*?).$tag/; + push @ret, "<b><a href='http://$host'>$host</a></b>", nl; + + my $sitepath = "$hostroot/$host"; + + my @pages = sort `find $sitepath -name \*.xml`; + for my $page (sort @pages) { + my ($site) = $page =~ m#$host/content/(.*)\.xml$#; + $site =~ s#\.sub/#/#g; + $site =~ s#\d\d\.##g; + next if $site eq 'home'; + my $sitelink = "http://$host?site=$site"; + push @ret, space, "<a href='$sitelink'>$site</a>", nl; + } + + push @ret, nl; + } + + join '', @ret; +} + +list SITEMAP; |
