~kris/9p

krisyotam.net

ref: 72f729adb07477a9fa8e0f15e542e8c39b19dc75 krisyotam.net/bin/aux/gensitemaptxt.rc -rwxr-xr-x 489 bytes
72f729ad — Kris Yotam rename to krisyotam.net, update site title, footer quote, tighten subtitle spacing 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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
}

}