(A Creative Blog Name Here)

Code, math, and other things I find useful

Migrating the Blog to Github Pages

The account at my former institution was recently deleted. Unfortunately, I was hosting this blog there and so I was forced to migrate it somewhere else. I have always wanted to host the blog on Github Pages (where my site is hosted) and this seemed like good enough excuse to finally do this. I wanted to record the small hiccups I ran into.

Previously I could build the blog content with make html, however, this did not work anymore on Github Pages. Strangely, the command pelican -s pelicanconf.py . does work, so I updated the html rule in Makefile to use the pelican command.

In order for Github to render the blog the files in the output/ directory must be pushed to the gh-pages branch (the blog source is on master). The Pelican documentation suggests using the ghp-import script (install with pip install ghp-import) in order to automatically set up the necessary branches. Then we can just push to the gh-pages branch.

The full pipeline to generate the blog content is now (note make html has been updated):

make html
ghp-import output
git push origin gh-pages

As the Pelican documentation suggests these steps can be added to a post-commit hook.