Setting Up a Blog from Scratch

Several months ago, I came across homepages and blogs that looked simple but elegant and are powered by Hugo, an open-source static site generator. I thought I should give it a try some day (which I did eventually). At the same time, I also realized that it is possible to use GitHub or GitLab to host a website.

This homepage is set up using Hugo and GitLab. I compiled a rough instruction to share with others.


1. Install Hugo

2. Get a GitLab account

3. Create a GitLab page

4. Set up Hugo Academic theme for GitLab

Since the Hugo repository is hosted by GitHub, forking under GitLab does not work. To circumvent this use the following commands instead of git clone:

git remote add upstream https://github.com/sourcethemes/academic-kickstart.git
git pull upstream master

Then

git submodule update --init --recursive

Configure Hugo by editing /config/_default/config.toml. Don’t forget to set baseurl = "https://<username>.gitlab.io"

Add a CI/CD pipeline for GitLab and push the changes to the repository:

wget https://gitlab.com/pages/hugo/raw/master/.gitlab-ci.yml
git add .
git push origin master

5. (Optional) Install ox-hugo

Avatar
Jae Hee Lee
Postdoctoral Research Associate
comments powered by Disqus