Learning GoHugo & Deploying to Netlify

I wanted a portfolio site. Not a WordPress site, not a hosted builder, and not something that required maintaining a server. Just files. Static HTML, served fast, deployed automatically when I push to GitHub.

Hugo fit that brief well. It's a static site generator written in Go — you write content in Markdown, Hugo templates handle the layout, and the output is plain HTML ready to serve anywhere. Build times are measured in milliseconds even on large sites.

Getting started

Hugo's install is straightforward — a single binary, no runtime dependencies. The PaperMod theme is added as a Git submodule, which keeps it easy to update independently from your content:

hugo new site my-portfolio
cd my-portfolio
git submodule add https://github.com/adityatelange/hugo-PaperMod themes/PaperMod

Content lives in the content/ directory as Markdown files with YAML front matter. Posts, pages, taxonomies — all just files. No database, no admin panel.

Configuration

Hugo's config file (hugo.yaml) handles site-wide settings, menus, and theme parameters. The learning curve here is knowing which parameters belong to the theme vs. Hugo core. The PaperMod docs are decent, but you still end up reading the theme's source code to understand some options.

The thing nobody tells you about Hugo is that Go templates feel alien if you're coming from any other templating language. The pipe syntax and context scoping take time to click. Once they do, it's actually elegant — but budget some head-scratching time.

Netlify deployment

Netlify watches your GitHub repository and rebuilds the site on every push. Setup is a few clicks in the Netlify dashboard — connect the repo, set the build command (hugo), set the publish directory (public), done.

For more control, a netlify.toml in the repo root lets you pin the Hugo version and configure redirects or headers:

[build]
  command   = "hugo --minify"
  publish   = "public"

[build.environment]
  HUGO_VERSION = "0.146.0"

← Back to all posts