2018-05-18 01:15:25 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Sitemap generator
|
|
|
|
# Assumes we have the latest version of the site under "latest" and "pmd-${RELEASE_VERSION}"
|
2018-05-18 01:25:40 +02:00
|
|
|
# https://www.sitemaps.org/protocol.html
|
2018-05-18 01:15:25 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
|
|
|
2018-05-18 01:25:40 +02:00
|
|
|
<url>
|
|
|
|
<loc>${WEBSITE_PREFIX}index.html</loc>
|
|
|
|
<priority>1</priority>
|
|
|
|
<changefreq>monthly</changefreq>
|
|
|
|
<lastmod>$DATE</lastmod>
|
|
|
|
</url>
|
|
|
|
|
|
|
|
<url>
|
|
|
|
<loc>${WEBSITE_PREFIX}${DOC_PREFIX}index.html</loc>
|
|
|
|
<priority>0.9</priority>
|
|
|
|
<changefreq>monthly</changefreq>
|
|
|
|
<lastmod>$DATE</lastmod>
|
|
|
|
</url>
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-18 01:15:25 +02:00
|
|
|
HEADER_END
|
|
|
|
|
|
|
|
|
2018-05-18 01:25:40 +02:00
|
|
|
for page in ${DOC_PREFIX}pmd_*.html
|
2018-05-18 01:15:25 +02:00
|
|
|
do
|
|
|
|
|
2018-05-18 01:25:40 +02:00
|
|
|
cat << ENTRY_END >> sitemap.xml
|
|
|
|
<url>
|
|
|
|
<loc>${WEBSITE_PREFIX}$page</loc>
|
|
|
|
<priority>$LATEST_PRIORITY</priority>
|
|
|
|
<changefreq>monthly</changefreq>
|
|
|
|
<lastmod>$DATE</lastmod>
|
|
|
|
</url>
|
2018-05-18 01:18:07 +02:00
|
|
|
|
|
|
|
ENTRY_END
|
2018-05-18 01:15:25 +02:00
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "</urlset>" >> sitemap.xml
|
|
|
|
|