Setup a blog with Hugo and Github Pages

Intro

It was long my desire to write a blog with stuff that interests me.
Lately i was studying Golang and i came across Hugo which is a really nice and fast site generation utility.
This was a great opportunity to start my own blog by using Hugo and Github Pages in order to host it. Why?

This is a walk through on how you can have a blog easy, fast and free! Let’s start! The only thing you need is:

Steps

The following steps are needed for the initial setup and creation of the blog:

  1. Github repository for source code of the blog
  2. Github Pages repository for the generated site
  3. Setup Hugo
  4. Create blog
  5. Publish blog to Github Pages
  6. Generate content and publish
  7. (Optional) Setup sub domain to point to blog

1. Github repository for source code of the blog

Create a repository (public or private).

2. Github Pages repository for the generated site

Follow the instruction on Github Pages to create a repository with your Github username. Clone it to your local drive.

3. Setup Hugo

Download Hugo to your local drive. Unpack it to a folder and set the path in your OS to the executable. Almost all OS are supported!!!

4. Create blog

Please refer to Hugo’s documentation for generating content, using themes etc.

5. Publish blog to Github Pages

When we are ready to deploy our blog we do the following:

After this we can enjoy our newly created blog under http://{username}.github.io where username should be replaced with your Github’s username.

6. Generate content and publish

After our initial commit we can now generate more content and publish it (Step 5).

7. (Optional) Setup sub domain to point to blog

Let’s assume you have a sub domain blog.domain.com. The only thing you need to do is to setup a CNAME entry in your DNS configuration and point it to {username}.github.io, add a file with name CNAME and content blog.domain.com to the root folder of the repository created in step 2, commit and you’re done.

Conclusion

With these six (the seventh is optional) easy steps we have created a fully functional and fast blog. The cherry on top: for free!!!
(If we used public repositories in Github). And if we assume that almost everybody nowadays has a domain it is free even with the 7th step!

Happy blogging!

comments powered by Disqus