RE: creating a blog with blogdown, hugo and github

Amber Thomas wrote a really good blogpost on how to use blogdown, hugo and github to create your own blog. Like so many others I had been meaning to create a personal blog using GitHub Pages and her tutorial came at exactly the right time. I’m familiar with GitHub, git and R so that part was easy. Until I reached the part about creating a subrepository and havin all website files on the master branch. That seemed overly complicated to me and I endevoured to find a method that satisfied my laziness.

At work we run a GitLab instance and I remembered that in one of their newsletters they mentioned something about GitLab Pages. Having looked into it for about 10 minutes I decided to take the leap and set up a repository for my personal blog. The steps are pretty much the same as in Amber Thomas’ post. The only difference is that GitLab works with so called Runners to generate the website. A GitLab Runner is a process which runs a job. Normally it used in conjunction with GitLab CI to automate the testing of your code and building any artifacts (e.g. R package zips or Java jar files). But for GitLab Pages a Runner can be used to build the website. All you need to do is specify a yaml file in your repository and select a Runner.

That may sound daunting but GitLab have provided a number of template repositories that you can use. Simply clone a repository (for example this Hugo-powered blog and you’re good to go. As I decided to follow Amber Thomas’ steps that wasn’t an option for me. Instead I uploaded all the files to my master branch, added a yaml file (that I copied from a template repository) and selected a Runner. That’s it! Once the Runner had finished building the website my words had been immortalised on the internet.

I’m probably just scratching the surface of both GitLab Pages and blogdown but I find that strangely exciting. Here are some links that I used to help me along the way: