So, you want to dive into creating a blog with Hugo? 😎 I've been meaning to pen this down for a while because when I first got into Hugo, I made more mistakes than I'd like to admit. If you're like me and often find yourself saying, 'I wish there was a simpler way!', well, here we go!
I'll be honest, setting up a Hugo blog took me weeks the first time around. There was a scary moment when I accidentally deleted my entire content folder (yeah, don't do that). But after a ton of trial and error, I've finally found a flow that works seamlessly. Here's the lowdown on setting up a Hugo blog from scratch.
Why Hugo?
Hugo is a static site generator and it's super fast. Like, blink-and-you-miss-it fast. The learning curve is gentle, yet powerful enough for complex use cases. Plus, it's perfect for those of us who want our pages to load faster than a pizza delivery. 😉
Getting Started
First things first, you need to have Go installed on your system, as Hugo is written in Go. Once you've got that sorted, installing Hugo is a breeze. Just run:
brew install hugo
This is assuming you're on a Mac. If you're on Windows or Linux, the official docs have you covered.
Now, create a new Hugo site with:
hugo new site my-awesome-blog
And don't worry, you can rename it later if you suddenly come up with a cooler name. 😂
Choosing a Theme
This is where I stumbled. There are so many themes, but not all of them are maintained. Check out the Hugo Themes site and pick something that fits your style. My personal tip: Choose a theme that's actively maintained, or you might end up spending hours fixing bugs.
Create Some Content
Let's get to the fun part - writing your first post! 🎉 You can create new content with:
hugo new posts/my-first-post.md
This command generates a markdown file where you can pen down your thoughts. Here's what your markdown might look like:
---
title: "My First Blog Post"
date: 2026-03-23T15:00:00Z
draft: true
---
# Hello World!
This is my first post and it's powered by Hugo!
If you're like me and need a bit of markdown guidance, I wrote a markdown guide that might help you out.
Building and Running Your Site
At this point, I'm usually too excited to see my site live. 😅 Run the Hugo server to see it in action:
hugo server
Your site is now live at http://localhost:1313. And the best part? Auto-refresh! Make edits and see them reflected instantly.
Deploying Your Blog
Finally, it's time to show off your hard work to the world. The easiest way to do this is through platforms like GitHub Pages or Netlify. A quick 'git init' and 'push' to GitHub, and your blog is halfway there.
For a Netlify deployment, just drag and drop your 'public' folder or connect your repo and let Netlify do the magic. If you want a step-by-step guide, I wrote a piece on deploying with Netlify that might be useful.
One more thing before I forget: Always backup your content folder. Losing your posts to one wrong command is no fun. Trust me, I learned it the hard way. 😬
If you've made it this far, give yourself a pat on the back. You've just built a blog with Hugo! 🎉 Try it out, and let me know how it goes. Drop a comment if you get stuck anywhere. I'll update this post if I find a better approach. Until next time, happy coding! 😊