Resources

Dev cheatsheet for this Hugo + hugo-coder blog. Exhaustive list in repo COMMANDS.md.

Daily flow Link to heading

hs                       # start dev server with drafts → localhost:1313
hpost "TCP Handshake"    # new post, auto-slugged
# write... set draft=false, set categories
# Ctrl-C to stop

Create new content Link to heading

# new post in a topic folder (draft=true by default)
hugo new content posts/linux/dns-resolution-rules.md
hugo new content posts/docker/volume-internals.md
hugo new content posts/k8s/pod-lifecycle.md
hugo new content posts/networking/tcp-handshake.md

# standalone page (then add a menu.main entry in hugo.toml)
hugo new content about.md

New file seeded from archetypes/default.md.

Topic organization Link to heading

Two layers — use both:

  • Folder (content/posts/linux/) = files tidy on disk (section).
  • categories front matter = browsable topic pages at /categories/linux/.

Pick fixed lowercase names: linux, networking, docker, kubernetes. Dockerdocker → two separate pages.

+++
title = "DNS Resolution Rules in Linux"
date = 2026-06-17
draft = false
categories = ["linux"]        # topic → /categories/linux/
tags = ["dns", "resolver"]    # sub-detail
series = []                   # multi-part posts only
authors = ["Khizer Rehan"]
+++

Publish = flip draft = false. `

` in body = cutoff for list-page summary.

Preview / build Link to heading

hs                      # serve incl. drafts
hsf                     # serve published only (what visitors see)
hugo server -D --navigateToChanged   # auto-jump to edited page
hb                      # production build → public/
hclean                  # wipe public/ + resources/_gen cache

Zsh aliases Link to heading

export BLOG_DIR="/Users/mac/Work/Github/AI/khizerrehandev"

alias blog='cd "$BLOG_DIR"'                               # jump to the blog
alias hs='hugo server --buildDrafts'                      # dev server (incl. drafts)
alias hsd='hugo server --buildDrafts --disableFastRender' # full rebuilds on change
alias hsf='hugo server'                                   # serve only published posts
alias hb='hugo --minify'                                  # production build -> public/
alias hbd='hugo --minify --cleanDestinationDir'           # clean build
alias hclean='rm -rf "$BLOG_DIR/public" "$BLOG_DIR/resources/_gen"' # clear output/cache
alias hver='hugo version'                                 # show Hugo version

# Create content (usage: hnew posts/my-title.md)
hnew() { hugo new content "$@"; }

# New post by title (usage: hpost "My Post Title")
hpost() {
  local slug
  slug=$(echo "$1" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-')
  hugo new content "posts/${slug}.md"
}

# Update the theme submodule to latest
alias htheme='git -C "$BLOG_DIR" submodule update --remote --merge'

Customize theme (no edits to submodule) Link to heading

Mirror a theme file into root layouts/, edit your copy — Hugo prefers it.

# example: footer override (already done)
themes/hugo-coder/layouts/_partials/footer.html  →  layouts/_partials/footer.html

Config-driven footer tagline via hugo.toml:

[params]
  footerText = "All rights reserved"   # "" to hide

Theme docs: open themes/hugo-coder/docs/.

Quick reference Link to heading

WantWhere
Site title, menu, social, paramshugo.toml
New-post default front matterarchetypes/default.md
Topic page/categories/<name>/ (auto)
Override theme layoutlayouts/<same-path-as-theme>
Avatarstatic/images/params.avatarURL
Full command listCOMMANDS.md