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