๐ One-Time Setup
# Create new Hugo site
hugo new site sourabhkourav
cd D:\dev\hugo-blog\sourabhkourav
# Initialize Git
git init
# Add PaperMod theme
git submodule add https://github.com/adityatelange/hugo-PaperMod themes/PaperMod
# Connect to GitHub
git remote add origin https://github.com/sourabhkourav/sourabhkourav-blog.git
git branch -M main
git push -u origin main
๐ Creating a New Post
# Step 1 โ Create post file
hugo new posts/my-post-title.md
# Step 2 โ Open and edit the file
# content/posts/my-post-title.md
Post front matter template:
---
title: "Your Post Title"
date: 2026-03-15
draft: false
description: "Short description for SEO"
tags: ["tech", "coding"]
categories: ["Tech"]
cover:
image: "/images/cover.jpg"
alt: "cover image"
---
Your content here...
๐ Creating a New Page (with Menu)
# Step 1 โ Create page file
hugo new contact.md
hugo new uses.md
hugo new now.md
Step 2 โ Open hugo.toml and add to menu:
[[menu.main]]
name = "Contact"
url = "/contact/"
weight = 3
[[menu.main]]
name = "Uses"
url = "/uses/"
weight = 4
Step 3 โ Push to deploy:
git add .
git commit -m "add contact page"
git push
โ๏ธ Draft โ Preview โ Publish Workflow
# Step 1 โ Create post (draft: true by default)
hugo new posts/my-post-title.md
# Step 2 โ Preview draft locally
hugo server -D
# Open http://localhost:1313 to see draft
# Step 3 โ When happy, open the .md file
# Change draft: true โ draft: false
# Step 4 โ Preview again without drafts
# (exactly like live site)
hugo server
# Step 5 โ Publish
git add .
git commit -m "publish: my post title"
git push
๐ Schedule a Future Post
# Step 1 โ Create post with a future date
hugo new posts/my-future-post.md
Set a future date in front matter:
---
title: "My Future Post"
date: 2026-04-01
draft: false
---
# Step 2 โ Preview future posts locally
hugo server -D -F
# Note: Cloudflare will only show it
# after the date passes automatically
๐ข Daily Publish Workflow
# Stage all changes
git add .
# Commit with message
git commit -m "new post: your post title"
# Push to GitHub (auto-deploys to Cloudflare in ~30 sec)
git push
๐ผ๏ธ Images
# Step 1 โ Put image in static/images/ folder
# Example: static/images/my-photo.jpg
# Step 2 โ Use in post content

# Step 3 โ Use as cover image (in front matter)
cover:
image: "/images/my-photo.jpg"
alt: "description of image"
caption: "optional caption"
relative: false
โ๏ธ hugo.toml Common Changes
# Change site title
title = "Sourabh Kourav"
# Change description
description = "Tech, Life & Finance โ by Sourabh Kourav"
# Add new menu item
[[menu.main]]
name = "Contact"
url = "/contact/"
weight = 3
# Toggle features
ShowReadingTime = true
ShowShareButtons = true
ShowCodeCopyButtons = true
ShowBreadCrumbs = true
# Add Google Analytics
[services]
[services.googleAnalytics]
id = "G-XXXXXXXXXX"
# Update base URL when domain is bought
baseURL = "https://sourabhkourav.dev/"
๐ท๏ธ Tags & Categories
# Add to post front matter
tags: ["python", "tutorial"]
categories: ["Tech"]
# Auto-generates pages at:
# sourabhkourav.pages.dev/tags/python
# sourabhkourav.pages.dev/categories/tech
๐ Update Theme
# Update PaperMod to latest version
git submodule update --remote themes/PaperMod
git add .
git commit -m "update PaperMod theme"
git push
๐๏ธ Delete a Post or Page
# Simply delete the .md file
del content\posts\my-post.md
# Then push
git add .
git commit -m "remove post: title"
git push
๐ Git Reference
# Check status of changed files
git status
# See commit history
git log --oneline
# Undo last commit (keeps changes)
git reset --soft HEAD~1
# Pull latest from GitHub
git pull
๐ Folder Structure
sourabhkourav/
โโโ content/
โ โโโ posts/ โ blog posts
โ โโโ about.md โ standalone pages
โโโ static/
โ โโโ images/ โ all images go here
โโโ themes/
โ โโโ PaperMod/ โ never edit this!
โโโ hugo.toml โ site config
๐ Important Links
| What | URL |
|---|---|
| Live Blog | https://sourabhkourav.pages.dev |
| GitHub Repo | https://github.com/sourabhkourav/sourabhkourav-blog |
| Local Preview | http://localhost:1313 |
| Cloudflare Dashboard | https://dash.cloudflare.com |
| Hugo Themes | https://themes.gohugo.io |
| PaperMod Docs | https://github.com/adityatelange/hugo-PaperMod/wiki |
โ ๏ธ Important Rules
- Never edit anything inside
themes/folder - Always set
draft: falsebefore publishing - Images always go in
static/images/folder - Run
hugo server -Dto preview before pushing - When you buy
sourabhkourav.devupdatebaseURLinhugo.toml