summaryrefslogtreecommitdiff
path: root/sitemap.buetow.org/content/sitemap.inc.pl
diff options
context:
space:
mode:
authorPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 22:00:37 +0100
committerPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 22:00:37 +0100
commit2fab3867d291514b6666a8bd582fe8ae4896a1c0 (patch)
tree996160703a47ac88c61d2496187118a5fc0675b8 /sitemap.buetow.org/content/sitemap.inc.pl
parentee1d9d4243e970d102ea4f57bfacb379e5b25b3a (diff)
parente43a989acd2055661bb2d93454f2f7aa4e6e5177 (diff)
Merge
Diffstat (limited to 'sitemap.buetow.org/content/sitemap.inc.pl')
-rw-r--r--sitemap.buetow.org/content/sitemap.inc.pl33
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 () { "&nbsp;" 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;