#!/bin/bash #Should be called each time a page is updated, added or removed to update sitemaps echo '' > sitemap.xml echo '' >> sitemap.xml for l in *; do if [[ ! -d $l || $l == "_site" || $l == "_layouts" ]]; then continue fi files=`find ${l} -name "*.html" -type f` for f in $files; do c=(${f//"."/ }) c=${c[@]:0:1} if [[ $c == "${l}/index" ]]; then c=(${c//"/"/ }) c="${c[@]:0:1}/" fi t=$(stat -c "%y" ${f}) t=(${t//" "/ }) t=${t[@]:0:1} echo "" >> sitemap.xml echo " http://bitcoin.org/${c}" >> sitemap.xml echo " ${t}" >> sitemap.xml echo "" >> sitemap.xml done done echo '' >> sitemap.xml