Mar 29, 2026
--:--:--
🌫️
32.3°C
Breaking News
Loading breaking news...

How to Create a Blog with Hugo Static Site Generator

M

Mershal Editorial Team

Staff Writer

3 min read
How to Create a Blog with Hugo Static Site Generator

Discover how to build a fast, SEO-friendly site with Hugo in no time.

Why Hugo?

So you want to learn about creating a blog with Hugo? I struggled with this for months, so here's what I learned. Honestly, it took me weeks to figure this out. Hugo is an amazing static site generator, but that doesn't mean it's beginner-friendly. Pro tip from someone who's been there: don't skip the config files! 😅

First Steps

When I first tried setting up Hugo, I made this stupid mistake of not installing Go. Spoiler: it took me 3 hours to debug what was a typo. Make sure to install Go first if it's not already there.

brew install go

Then, get Hugo:

brew install hugo

Easy enough, right? Everything works as a breeze once you have these prerequisites sorted.

Setting Up a New Site

Now, create a new Hugo site:

hugo new site myblog

This will create a directory structure for your blog. Trust me, don't mess with this structure unless you know what you're doing (I did, and it wasn’t pretty).

Choosing a Theme

Honestly, picking a Hugo theme can be overwhelming. If you're like me, you've probably wondered: 'Do I go for style or functionality?' Both can be achieved. Head over to Hugo Themes and pick one that suits your needs.

git submodule add https://github.com/theuser/theme.git themes/theme

Don't make my mistake! Use Git submodules for theme management; it'll save you a ton of hassle later on.

Writing Content

Let's get into writing our first post:

hugo new posts/my-first-post.md

This will create a Markdown file for your post. Here's the code that finally worked for me:

---
title: "My First Post"
date: 2026-03-23
draft: true
---

Editing the Markdown files is straightforward, which is why I love Hugo. Honestly, Markdown feels like writing notes with a bit of flair.

Preview Your Site

Run your local server:

hugo server

Visit http://localhost:1313 to see your blog. I still remember the frustration of not seeing changes. Pro tip: clear your cache if things seem outdated.

Deploying Your Blog

Deploying can be scary, but here's what worked for me:

hugo -D

Then get those files onto your server using your preferred method. I personally prefer Netlify for its ease of use, but there are many options out there.

Conclusion

I'm not an expert, but here's what worked for me. There are better ways, but this is what I use. This snippet saved my project, hope it helps you too. Try this out and let me know how it goes! I'll update this post if I find something better.

Btw, I wrote about configuring the Go environment last week - check it out! If you enjoyed this, you might like my post on static site generators.

Share This Article

Related Articles