add support for compressing files

This commit is contained in:
Solene Rapenne 2021-10-10 20:44:13 +02:00
parent a337a52277
commit b6beda30b7
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,7 @@ generate-site: clean
gzip -9 -c ../public/sitemap.xml > ../public/sitemap.gz
tools/atom.sh webzine.puffy.cafe > ../public/atom.xml
xmllint -format ../public/atom.xml
tools/compress_static.sh
puffy: clean
tools/make_issue.sh _puffy.cafe ../public/index.html

13
issues/tools/compress_static.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
die() {
echo "$1"
exit 1
}
test -d ../public/ || die "You must run this from openbsd-webzine/current"
find ../public/ -name '*.html' -or -name '*.xml' | while read file
do
gzip -9 -c "${file}" > "${file}.gz"
done