Hugo Basics You’ll Use Every Week
Colin Blackman
A quick reference you’ll use constantly:
New content
hugo new posts/my-next-post.md
- Edit the file under
content/posts/… - Set
draft: falseto publish.
Local preview
hugo server -D
-Dshows drafts.- Live-reload updates as you edit.
Front matter fields
title,date,draft,description,tags,categories.- Add
slugto customize the URL.
Static files
Anything in /static is served at the site root. Put images, favicons, etc. there.
Shortcodes
Hugo shortcodes let you embed components inside Markdown. For example:
{</* youtube w7Ft2ymGmfc */>}
Check your theme docs for more.
Build
hugo
Outputs static files into /public for deployment.
Pro-tip: PR previews
Open a pull request for big posts. Cloudflare Pages will create a preview URL so collaborators can review before it goes live.