shithub: werc

ref: 95944a9760305a80ede481b6e78edd347a1240f7
dir: /bin/aux/gensitemaptxt.rc/

View raw version
#!/bin/rc
# DEPRECATED: sitemap.tpl now generates and updates a sitemap.txt when requested, and is also more smart than this simplistic script.

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
}

}