#Git

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.).