2022-10-22
This blog uses Github Pages as host and Zola as the static site generator.
Since I want the repositories related to this blog to be private I ended up making 2. One for the Zola source files and another for the build files, the ones to be uploaded to Github Pages.
The Github Page repository is added as a git submodule of the Zola repository. To build in one command there is the following Makefile.
build:
zola build
find <github-user>.github.io ! -name .git ! -name CNAME -delete
cp -R public/* <github-user>.github.io
This works as follows:
public
directory..git
directory and the CNAME
file.public
directory to the blog repositryAfter that we go into the <github-user>.github.io
folder, commit and push the changes to the submodule.