From 94068c3cffa74cf99906e53bb7cef018baa94b19 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 15 May 2024 01:52:10 -0400 Subject: generate sitemap as part of deployment This allows adding the lastmod field based on the last modification date of the file. --- deploy-static | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'deploy-static') diff --git a/deploy-static b/deploy-static index 9d45560c..64086281 100755 --- a/deploy-static +++ b/deploy-static @@ -19,10 +19,16 @@ rsync -pcv --chmod=F644 --fsync --preallocate replicate.conf root@${servers[0]}: # use last modified timestamps from 0.grapheneos.org rsync -rptcv --chmod=D755,F644 --delete --fsync --preallocate root@${servers[0]}:/srv/grapheneos.org/ static-production +rsync -pcv --chmod=D755,F644 --fsync --preallocate static-production/sitemap.xml{,.gz,.br} static-tmp/ rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-tmp/ static-production for f in static-production/**.*(br|gz); do touch -r "${f%.*}" "$f" done +./generate-sitemap +xmllint --noblanks static-tmp/sitemap.xml --output static-tmp/sitemap.xml +brotli -f static-tmp/sitemap.xml +zopfli static-tmp/sitemap.xml +rsync -pcv --chmod=D755,F644 --fsync --preallocate static-tmp/sitemap.xml{,.gz,.br} static-production/ for server in ${servers[@]}; do echo $server -- cgit v1.3.1