I’ve been using n.ethz.ch to host my personal website for a number of years now. I was always quite glad that we had access to such a service; not only as an easy means to host content, e.g. for exercise sessions, but also as a cool relic of the internet of a bygone era, where people used cobbled together HTML 2.0 pages in place of social media.1 Therefore, I was quite disappointed to learn that n.ethz.ch is shutting down by year’s end.
However, in the spirit of “never waste a good crisis”, I took the opportunity to re-build my website from scratch. It seems like everyone’s first article talks about their website’s design and tech stack, so I thought I might as well do the same (and have something to make sure everything is working as intended).
Jekyll
My old webpage consisted entirely of hand-written HTML and CSS. Since I’m now using GitHub pages for hosting, which has dedicated Jekyll support and Jekyll furthermore allows me to comfortably write posts in Markdown, my first order of business was selecting a template I liked. In the end, I settled for LightSpeed, which I subsequently modified to fit my needs.
Upon deploying for the first time, I noticed that my posts page wasn’t working correctly, even though it was works-on-my-machine certified. Turns out the default automatic GitHub pages deployment only supports a handful of select Jekyll plugins, of which jekyll-paginate-v2 is not one. Thus, I would need to write a custom Action that deploys the page.
Unfortunately, writing GitHub Actions is my least favourite thing in the world. Thankfully, ChatGPT exists and it was able to quickly oneshot something functional.
More Actions
Next, I took the initiative to automate something I have always found quite tedious: Updating my SPCA exercise collection PDFs when I make changes. To this end, I (mostly hand-wrote!) a GitHub Action for my exercise collection repository, which automatically compiles the $\LaTeX$ into a regular version and a version with solutions.
My exercise collection uses the exam document class, which allows me write everything in one document and then toggle displaying solutions using the \printanswers macro. To generate both versions from one document, I shim in the macro as so:2
- name: Build Regular
  run: |
    pdflatex -interaction=nonstopmode -jobname=exercise_collection main.tex
    pdflatex -interaction=nonstopmode -jobname=exercise_collection main.tex
- name: Build Solution
  run: |
    pdflatex -interaction=nonstopmode -jobname=exercise_collection_sol '\AtBeginDocument{\printanswers}\input{main.tex}'
    pdflatex -interaction=nonstopmode -jobname=exercise_collection_sol '\AtBeginDocument{\printanswers}\input{main.tex}'
Finally, I check out website repository and commit the newly generated PDFs. By setting
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
I can even make the commit history look nice and orderly.