#Hugo

Hosting Multiple Gitlab Pages from One Account

This is a short post on how to host multiple Gitlab project pages using a single Gitlab account. This task is actually very simple, but I could not find any documentation on it when I tried a couple weeks ago. I ended up resorting to creating a second Gitlab account. Turns out you do not need to use this hack, and this post will explain how to legitimately host multiple gitlab pages with just one account.

Deploying a Hugo site on Gitlab

As I mentioned in the previous post’s footnote, I actually decided to host this site on GitLab primarily because GitLab is awesome (requires no maintenance on my part, has free private repositories, and natively supports Hugo). There is also good documentation on how to use Hugo with Gitlab from both Hugo and GitLab; however, I ran into a couple small issues I felt were worth addressing. Path, not project name, determines your site URL. I spent some time trying to figure out why my site was not working when it was simply under a subfolder. As documented here, you are recommended to name your new repo namespace.gitlab.io, where namespace is your username or groupname. If you do not use this conjention, your site will be available at namespace.gitlab.io/repo. I initially named by repo mjkranch.com and then changed it to archang31.gitlab.io under my project->settings->general->general project; however, I still needed to visit https://archang31.gitlab.io/mjkranch.com/ to view my site and not simply https://archang31.gitlab.io/. The issue is the url is really based on the project path and not the project name (notice the difference in the two in Figure 1.).

My new Hugo website

I’ve had a website for a little over a year now, but I recently had several technical experiences that I really want to share with the world. As such, I decided it was time to create a blog. Three weeks and several frameworks later, I decided upon using Hugo. I still think I will ultimately end up switching to Django due to some of the more advanced goals I eventually have for my own cite (namely, hosting my own web CTF), but I felt I was delaying doing what I really wanted to do (writing the posts) while I spent time learning how to leverage all the CMS and blog template features of Django. In the meantime, I settled on Hugo. One of my good friends, Roy Ragsdale, strongly recommended the framework. When looking for static site generators, Jekyll is currently the other main alternative to Hugo though they are fairly similar. Jekyll’s integration with GitHub pages almost tipped me in that direction, but I liked the larger diversity in supplied Hugo themes.1 I also run my own server so the GitHub support does not matter.