Satish's Scribbles

Create Personal Blog Using Hugo

What is Hugo?

  1. Hugo is a fast and flexible static site generator.
  2. Offers a wide range of cool themes to customize your site.
  3. Write in Markdown and see your content rendered beautifully on your website.

Steps to Build Your Blog

1. Install Hugo

Install Hugo on your system:

1brew install hugo

2. Create a New Website Project

Run the following command to create your project:

1hugo new site my-blog 

Navigate into the project folder:

1cd my-blog

Setup hugo.toml file:

1baseURL = 'https://example.org/'
2languageCode = 'en-us'
3title = 'My Blogs'

3. Install a theme; Let’s install xmin theme

The xmin theme is a minimalist theme with essential features. Add it to your project:

1git init
2git submodule add https://github.com/yihui/hugo-xmin themes/xmin

Update the hugo.toml file to use the theme:

1theme = "xmin"

4. Create Posts in Markdown

Create your first post:

1hugo new posts/first-post.md

Edit the file in content/posts/first-post.md:

1---
2title: "First Post"
3date: 2025-01-01
4draft: false
5---
6
7Welcome to my blog! This is my first post using Hugo.

5. Build and Run Your Blog

Run a local server to preview your blog (in development mode):

1hugo server -D

Run a local server to preview your blog (in production mode):

1hugo server

Access it in your browser at http://localhost:1313.

That’s It!

Minimalist blog using the xmin theme is ready to go. Start writing, customize, and share your stories with the world. 🚀

Reply to this post by email ↪