As this website is hosted on GitLab pages, I cannot enable Gzip compression on
the server side. Previously, I used the jekyll-gzip
plugin. Zola does not
support plugins and also has no built-in way to enable compression. So I
examined how the jekyll-gzip
plugin worked: it creates a gzipped version of
each file alongside it, e.g.,
This is fairly trivial to implement using a shell script, which I now include in my build process:
#!/usr/bin/zsh
extensions=(".css" ".htm" ".html" ".png" ".jpg" ".jpeg" ".gif" ".svg" ".woff2")
for; do
for; do
done
done
This particular example needs zsh to work, in order to support the **
recursive globbing operator, but this functionality should be fairly easy to
replicate in other shells. :)