#!/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="latest/" # "pmd-${RELEASE_VERSION}/" DATE=`date +%Y-%m-%d` # Priority is relative to the website, can be chosen in {0.1, 0.2, ..., 1} # Default priority is 0.5 LATEST_PRIORITY=0.8 # Writes to standard output cat << HEADER_END ${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 ${WEBSITE_PREFIX}$page $LATEST_PRIORITY monthly $DATE ENTRY_END done echo ""