How I built this website
It’s still and always will be a work in progress.
TL;DR
- Caught inspiration to give this a try after reading some documentation from blogdown,
- A fair amount of trial and error using Hugo, and,
- Plenty of frustration (aka debugging).
The inspiration for this site
The truth is the motivation of building this website was my personal justification as an alternative study method. The idea was that I would write Rmarkdown
posts about actuarial science (within the general insurance domain) featuring modelling results on theoretical concepts required to be learnt as part of the
Institute’s exam syllabus.
As part of this I had been reading about blogdown which seemed promising and is very well documented. Unfortunately given the complex infrastructure behind the blogdown package (or perhaps that’s my excuse for just being dumb), I couldn’t get this to work in my preferred text editor, Visual Studio Code and having the output consistent with the theme I’m using (the Academic theme).1
Perhaps an additional motiviation was that I enjoy learning new things and this seemed like a good challenge. This website was created in 2020. Around the same time I started to mess around with Blender - see this post for more details.
I had previously only tried to build a website a couple of times before:
- Dabbling with Dreamweaver as a kid and not getting very far,
- Building a lottery based website, Warwick Accumulator Draw “WAD” as a university module, which was a lot of fun but a lot of work too. This was built back in early 2011 on Microsoft’s .NET framework.
I also want to take this opportunity to pass on some career advice. This advice actually comes from my first boss Mike Froom who offered me a graduate trainee position at KPMG Birmingham (which was a great graduate job and would highly recommend). I must quickly add a disclaimer that the quote is paraphrased:
“You should always challenge yourself by trying something new every six months.”
Given the above, it felt like a reasonable challenge to get up and running with a modern day website. So how was this website built and how can you build your own website, for free, hosted on GitHub?
How this site was built
So how specifically was this website built? The truth is that it took a fair amount of trial and error and reading plenty of documentation. I am certainly no software developer so I hope this can give anyone the confidence that they can also build their own 100% free2 website.
Here are the tools I’ve used to build this website:
- Git - download and install Git3 for free,
- Hugo - pick your own operating system’s binary release for free,
- GitHub - set up your own GitHub account for free,
- Academic Theme - fork the Academic Theme for free,
- Visual Studio Code - download and install Microsoft’s text editor for free,
The specific deployment to host on GitHub was based on documentation from Academic.
Over time my specific setup has changed:
- I use Windows OS but use a
bash
terminal within VS Code. - Wrote a
shell
script to automate deployment which works by:- Calling Hugo with no arguments, simply
hugo
, - Copies the Hugo generated public folder (representing the entire static website) into a separate repo,
- Change directory to the other repo and commit the git changes locally,
- Push these to the remote (GitHub repo),
- Change back to the Hugo repo and delete the public folder.
- Calling Hugo with no arguments, simply
- Changes to layout and theming is performed at the root directory, not within the theme folder
URL registration
Unfortunately garbiak.com was taken so I opted to register alexgarbiak.com as my custom URL. I am using Google Domains as the registrar of the domain. To link up the hosted content (on GitHub) with the URL I added a CNAME. Pretty straightforward with an annual fee payable of £10, seems reasonable. Some benefits of Google’s service:
- Access to Google’s DNS servers (fast and reliable you’d hope),
- Privacy (WHOIS), and
- 100 alias email addresses
-
The story doesn’t end there. Here is some more commentary on the matter.
Bookdown is an excellent resource for anyone interested inR
. Most resources on here are fully published books that are available, for free, in digital format. Specifically, my interest was piqued by the book hosted on here for theR
package blogdown. The book advocates using Hugo to build your statically generated website.
As part of my work at Hiscox I occasionally work inR
. My preferred IDE for such work is R Studio.R
is fantastic for data - loading, transformation, analysis and visualisation. R Studio is the best IDE for working inR
in my opinion. However, I personally find R Studio a little cumbersome for web development despite the existence of the blogdown package. Due to this I backtracked somewhat to read up on Hugo documentation. Here I discovered the Academic theme, which largely powers the user experience on this website. ↩︎ -
Free as in no monetary purchase is required. However as with everything in life, there are some restrictions. All the tools listed come with a variant of an open-source license (GNU General Public License, Apache, MIT, et. al.) ↩︎
-
It’s pretty terrible I only came across Git in late 2019. I am still yet to make use of its extensive functionality, but already consider it the most important tool within development. There are plenty of good tutorials you can Google for more help and the git-scm website is the reference guide. ↩︎