diff options
author | glenda <glenda@9front.local> | 2020-11-15 15:13:27 +0000 |
---|---|---|
committer | glenda <glenda@9front.local> | 2020-11-15 15:13:27 +0000 |
commit | 39318169e0b50551db511851829f9337c5fa6313 (patch) | |
tree | 65a0ef5c1da9677532fa8105293d017919473057 /bin/aux/gensitemaptxt.rc |
Import site to git
Diffstat (limited to 'bin/aux/gensitemaptxt.rc')
-rwxr-xr-x | bin/aux/gensitemaptxt.rc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/aux/gensitemaptxt.rc b/bin/aux/gensitemaptxt.rc new file mode 100755 index 0000000..a1b349d --- /dev/null +++ b/bin/aux/gensitemaptxt.rc @@ -0,0 +1,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 +} + +} |