#!/bin/bash # Sitemap generator # Assumes we have the latest version of the site under "latest" and "pmd-${RELEASE_VERSION}" WEBSITE_PREFIX="https://pmd.github.io/" DOC_PREFIX="pmd-${RELEASE_VERSION}/" LATEST_PRIORITY=0.8 DATE=`date +%Y-%m-%d` writePage () { local pageLoc=$1 cat << ENTRY_END >> sitemap.xml ${WEBSITE_PREFIX}$pageLoc $LATEST_PRIORITY monthly $DATE ENTRY_END } # Start of the output writing cat << HEADER_END > sitemap.xml HEADER_END for page in pmd-${RELEASE_VERSION}/pmd_*.html do writePage $page done for page in latest/pmd_*.html do writePage $page done echo "" >> sitemap.xml