How to start a blog using Hugo

Posted by Arun Tomar on 26 January 2021

Starting my blogging journey with Hugo

Happy New Year 2021. A new year. A new beginning. I've been thinking of starting a blogging site for so long. But no more excuses :)

After wasting too much time on evaluation of different blogging platforms I finally decided that let's just jump in and get started. I find the easiest platform to get started for me is Hugo. So, I'm dedicating my first blog post by writing about how I'm starting this journey with Hugo.

Why choose Hugo

There are many popular blogging platforms eg: wordpress. There are many static site generators in almost every popular programming language. I was looking for something simple to get started. A tool that's not in my way. Another criteria was that it should be popular and well maintained. Easy to install. Hugo fits perfectly in my required criterias because

  • It's extremely fast.
  • Simple to install. Just a single binary for every platform.
  • Lot of themes.
  • Supports markdown. Makes it easy to write & format.
  • It's open source.
  • A large community behind it.
  • A powerful templating engine. It's a little complex for non techies & for my liking though. But i guess, all templating engines are :)

Let's get started

Step 1: Install Hugo & create a blog site

To install Hugo on MacOS, from your terminal run

brew install hugo

brew command doesn't exist on your system? Checkout Homebrew installation

Install Hugo on other platforms.

Create a new blog site

hugo new site myblog

Note: You can choose any name. I've chosen myblog for demo purpose.

Step 2: Install a theme. I'm choosing even to get started. May be I"ll change or customise that later.

git submodule add https://github.com/olOwOlo/hugo-theme-even.git themes/even

Step 3: Modify config.toml to add the theme.

Activate the newly installed theme for your blog.

echo 'theme = "even"' >> config.toml

Step 4: Add first blog page

hugo new post/2021/01/first-blog.md

Step 5: Add content and publish

To publish, modify first-blog.md

draft = false

Step 6: Start local server

hugo serve

Step 7: View your blog

To access your blog locally from your system. Open this url http://localhost:1313 in your browser