My personal website.
Front-End
Vanilla JS, CSS, and Zola.
Back-End
pgs.
Install Zola: https://www.getzola.org/documentation/getting-started/installation/
brew install zola
You can run zola -r ./blog_zola serve -O
to view the site live.
Set up these pre-commit hooks:
cat > .git/hooks/pre-commit << EOF
#!/usr/bin/env bash
set -Eeuo pipefail
cd \$(git rev-parse --show-toplevel)
zola -r ./blog_zola build -o ./blog --force &
zola -r ./movies_zola build -o ./movies --force &
wait
git add ./blog ./movies
EOF
chmod +x .git/hooks/pre-commit
cat > .git/hooks/pre-push << EOF
#!/usr/bin/env bash
set -Eeuo pipefail
rsync -rv index.html static blog movies _headers pgs.sh:/www
EOF
chmod +x .git/hooks/pre-push
Then the blog will be rebuilt automatically every time you run git commit
and rsync'd
every time you git push
.
To set up pgs, first create DNS records in the zone macchaffee.com
:
CNAME www -> pgs.sh.
TXT _pgs.www -> "mac-www"
CNAME @ -> pgs.sh.
TXT _pgs-> "mac-www-redirect"
Set up redirects for the zone apex:
echo "/* https://www.macchaffee.com 301" > _redirects
rsync _redirects pgs.sh:/www-redirect
Upload the content:
rsync -rv index.html static blog movies _headers pgs.sh:/www