Documenting my experiences building a static site using Hugo: Part 1
I chose to begin my SSG journey by purchasing and registering a domain. I did so through Namecheap, which was quick and convenient.
I built my SSG on using Windows 10, PowerShell, and chocolaty. The Hugo website details different installation procedures depending on your setup. Here was my process:
choco install hugo -y
choco install hugo -confirm, but you can override
-yfor automatic yes.
hugo new site quickstart.
cd quickstart git init git sumbodule add https://github.com/<name-of-repo>.git themes/<name-of-theme>
echo 'theme = "<name-of-theme>"' >> config.toml.
hugo new posts/<file>.md
Files require a Hugo-specific header:
title: "Title-here" date: <date> draft: <true>
Hugo allows you to set your posts to:
expirydate in the front matter header. This allows you to control when your content will be published.
Depending on your theme, there may be additional notes for the header. For example, my headers also include:
image = "img/portfolio/<image>" showonlyimage = false weight = ##
This establishes the home page design.
A wonderful benefit to Hugo is the real-time rendering of your website. While updating content and pages, I can monitor how the changes will be displayed.
To start the Hugo server with drafts active:
hugo server -D.
http://localhost:1313information into Chrome.
This render will update as you make local changes.
When finished, in the terminal, press ctrl+c to stop the render.
worksfolder and an