How is this Website Built?

The sources for this website are available in a Git repository:

$ git clone https://mathieu.daitauha.fr/sources/

Feel free to have a look at it, take inspiration from it if you like anything I did, or point out my mistakes so I can improve it.

The website is automatically rebuilt every time I push a new version of the sources, thanks to a post-receive Git hook:

#!/bin/bash


set -o nounset
set -o errexit
set -o pipefail


SOURCE_DIR=/srv/www/daitauha.fr/mathieu.git


while read oldrev newrev refname; do
    branch=$(git rev-parse --symbolic --abbrev-ref $refname)

    if [ "main" == "$branch" ]; then
        OUTPUT_DIR=/srv/www/daitauha.fr/mathieu
        TEMP_CLONE=/tmp/mathieu.daitauha.fr
        VENV=/home/bochecha/mathieu.daitauha.fr

        # Clone the sources
        rm -rf ${TEMP_CLONE}
        git clone ${SOURCE_DIR} ${TEMP_CLONE} |& tee /dev/null
        cd ${TEMP_CLONE}

        # Update the installed dependencies, and rebuild the site
        ${VENV}/bin/pip install --upgrade -r requirements.txt
        ${VENV}/bin/pelican content -o output -s publishconf.py

        # Publish the newly-built site
        rm -rf ${OUTPUT_DIR}.bak
        test -d ${OUTPUT_DIR} && mv ${OUTPUT_DIR} ${OUTPUT_DIR}.bak
        mv output ${OUTPUT_DIR}
    fi
done


# Update auxiliary info file
(cd ${SOURCE_DIR} && git update-server-info)

Thanks!

This website is built and served using a few awesome Free Software tools:

Thank you to all developers and artists who made and shared them freely!

And of course a big thank you to 6clones for graciously hosting this website.