Thumbnail image

How to Create a Blog in 2025

Why Start a Blog?

Starting a blog is a great way to share your knowledge, express your creativity, and build an online presence. Whether you’re writing about technology, travel, food, or personal experiences, a blog can help you connect with like-minded individuals and even open up new opportunities.


How to Start a Blog

This guide will walk you through the process of creating a blog using Hugo, a fast and flexible static site generator, and hosting it on GitHub Pages.


Prerequisites

Before you begin, make sure you have the following tools installed:

  1. Git: Install Git from Git Guides.
    After installation, configure your Git username and email:

    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"
    
  2. Go: Download and install Go from Go’s official website.

  3. Hugo: Install Hugo by following the instructions on the Hugo installation page.
    If you’re on Windows, you can install Hugo using Winget:

    winget install Hugo.Hugo.Extended
    

Building the Website

Step 1: Create a New Hugo Site

Run the following command to create a new Hugo site:

hugo new site [YourWebsiteName]
cd [YourWebsiteName]
ls

alt text


Step 2: Select a Hugo Theme

Browse the Hugo Themes website and choose a theme you like.
Once you’ve selected a theme, copy its repository URL.

alt text


Step 3: Install the Theme

Add the theme as a Git submodule:

git submodule add -f [RepositoryUrl].git themes/[ThemeName]

alt text


Step 4: Configure the Theme

Most themes come with an exampleSite folder. Copy the hugo.toml (or config.toml) file from the exampleSite folder and replace the one in your project directory.
Edit the hugo.toml file to configure your site’s name, profile picture, links, and other details.

alt text

alt text


Step 5: Add Content

Create .md (Markdown) files in the content folder for your blog posts or pages. Follow the structure of the exampleSite folder to organize your content.

alt text


Step 6: Add Static Files

  • Images: Place images in the static/images folder.
    Example: static/images/your-image.jpg
  • Files: Place downloadable files (e.g., PDFs) in the static/files folder.
    Example: static/files/your-cv.pdf
  • Favicons: Place favicon files in the static/favicons folder.

alt text


Step 7: Configure the Portfolio

If your theme supports a portfolio page, copy the portfolio.yml file from the exampleSite folder to Website/data/portfolio.yml and customize it.


Build and Deploy the Website

Step 1: Build the Site

Run the following command to generate the static files:

hugo

alt text


Step 2: Initialize Git in the public Folder

cd public
git init

Step 3: Create a GitHub Repository

Create a new repository on GitHub with the name [githubUsername].github.io. This will allow you to host your site on GitHub Pages.

alt text


Step 4: Push Your Code to GitHub

Add the remote repository and push your code:

git remote add origin <remote_repo_url>
git add .
git commit -m "first commit"
git push -u origin main

alt text


Step 5: Enable GitHub Pages

  1. Go to your repository on GitHub.
  2. Click on Settings.
  3. In the sidebar, click Pages.
  4. Under Build and deployment, select Deploy from a branch.
  5. Choose the branch (e.g., main) and click Save.

Step 6: View Your Website

Visit https://[githubUsername].github.io to see your live website. Note that it may take up to 10 minutes for changes to propagate.

alt text


Custom Domain (Optional)

If you have a custom domain (e.g., from Namecheap, .TECH, or Name.com), you can configure it in your GitHub Pages settings. Follow the documentation provided by your domain registrar to link it to GitHub Pages.


Acknowledgments

This guide was inspired by NetworkChuck’s video. Check it out for a visual walkthrough!