Hugo is a great platform for static website creation based on Markdown (or HTML) files.
First, install Hugo:
- Mac:
brew install hugo
- Windows:
choco install hugo -confirm
More info: https://gohugo.io/getting-started/installing/
Just run the following command (a directory called quickstart
will be created holding your site - replace the name with whatever you want):
hugo new site quickstart
Find themes by searching for Hugo themes -- the "official source" is here: https://themes.gohugo.io/
If you have git installed, the best way to add a theme is by including the theme as a submodule (replace quickstart
with whatever you used above and use whatever theme you like):
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
Creating new pages / posts / etc is usually done with the hugo new
command, and can refer to archetypes
. Refer to the theme you've chosen for supported archetypes.
hugo new --kind post posts/my-new-post.md
Edit the metadata at the top of the markdown to reflect what you want:
---
title: "My First Post"
date: 2019-03-26T08:47:11+01:00
---
If there is a draft: true
value, the page will not be included in the site. Remove that line or set it to false to be able to see the page.
From a terminal, run the following command to launch the site:
hugo serve
Then open a browser and go to http://localhost:1313