commit 27a56e3860765e36e6d4cdc3fd7c39b4d57c51fc
parent 7f53957543e3337426ac65a73a46386cef8596dd
Author: uriel@suckless.org <unknown>
Date: Mon, 7 Jul 2008 15:19:52 +0200
Autogenerate robots.txt files pointing to sitemap.txt
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/bin/gensitemaptxt.rc b/bin/gensitemaptxt.rc
@@ -4,4 +4,10 @@ for ( d in sites/*/ ) {
echo $d
9 du -a $d | awk '/\.(md|html)$/ { print $2 }; {}' | 9 sed -e 's/\.(md|html)$//' -e 's,/index$,/,' -e 's,^sites/,http://,' > $d/sitemap.txt
+if(! test -f $d/robots.txt) {
+ echo generating missing robots.txt for $d
+ echo $d|sed 's,sites/,Sitemap: http://,; s/$/sitemap.txt/;' > $d/robots.txt
+ cat $d/robots.txt
+}
+
}