This page looks best with JavaScript enabled

How to create a static web by Hugo

 ·  ☕ 2 min read

Install Hugo

My system environment is Windows 10 x64, Other platform can refer Official


Go to Hugo’s GitHub Releases, download the latest version of Windows-64bit.zip

The latest version is 0.71.0, file name is hugo_0.71.0_Windows-64bit.zip
or hugo_extended_0.71.0_Windows-64bit.zip (if you will use SASS / SCSS)


Unzip it after downloading, remember the path.

Add the path to system environment variables

This PC > Properties > Advenced system settings > Environment Variables > System variables > Select Path and click Edit > Add the path


hugo add path

Run the CMD

Enter the following command to check if it works

1
hugo version

hugo version

Create a website by Hugo


CMD again
cd to your workpath, e.g. D:\Blog

Run the below command (mysite can be replaced)

1
hugo new site mysite

hugo new site mysite

Directory Structure will like this

└─mysite
    │  config.toml
    │
    ├─archetypes
    │      default.md
    │
    ├─content
    ├─data
    ├─layouts
    ├─static
    └─themes

Intro

  • config.toml:configure file, format can be tomlyamljson
  • archetypes:Archetypes are templates used when creating new content.
  • content:Put .md files
  • data:Store additional data, format can be jsonyamltoml
  • layouts:Put templates
  • static:Static files like cssjsimages
  • themes:Save the themes, go Hugo Themes to pick one

Add theme.
Go Hugo Themes to pick one, I choose Zzo.

Then, Git is needed.
cd to the root of the website, enter the commands below
or go GitHub to download zip file and unzip to themes folder.

1
2
git init
git submodule add https://github.com/zzossig/hugo-theme-zzo.git themes/zzo

hugo add theme

After that, delete config.tomlcontentstatic from root folder.

Copy and replace configcontentresourcesstatic from .\zzo\exampleSite to the root folder of the website.

Run the command and then it will build the website, it also support Live Reload.

1
hugo server

hugo server

Open the browser, go to http://localhost:1313


hugo demo

OK, Customize your site.
Zzo theme can refer Zzo docs.

Share on
Support the author with

JIHONGO
WRITTEN BY
JIHONGO
A Person