2016-12-21 19:38:03 -07:00
|
|
|
#!/bin/rc
|
2008-10-25 20:37:52 -06:00
|
|
|
# DEPRECATED: sitemap.tpl now generates and updates a sitemap.txt when requested, and is also more smart than this simplistic script.
|
|
|
|
|
2008-12-20 16:13:53 -07:00
|
|
|
for(d in sites/*/) {
|
2008-10-25 20:37:52 -06:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|