Hugo Minimal Setup Guide
Hugo is a framework for building websites with exceptionally fast build and deployment speeds. When it comes to installation and configuration on Windows, the official documentation lacks detailed instructions, and third-party tutorials vary in quality. Therefore, I have crafted this tutorial to fill the gap.
Download and Installation
- Navigate to the Releases page on Hugo's official GitHub.
- Choose the latest version for download (select
hugo_xxx_Windows-64/32bit.zip
). - Extract the
hugo.exe
file from the downloaded zip archive to theD:\hugo
directory. - In Windows File Explorer (commonly known as "My Computer"), right-click on an empty area and open "Properties."
- Click on "Advanced system settings" and then "Environment Variables."
- Under the System Variables section, double-click on "Path."
- In the Environment Variables window, double-click on an empty row and add
D:\hugo
. Click "OK."
Open the Command Prompt and enter the following command:
This will confirm whether Hugo has been successfully installed (the version number should be displayed if it is).
Create a Site
Navigate to the desired directory and use the following command:
This will create a new Hugo site within a folder named quickstart
.
Add a Theme
You can explore and select themes from the official Themes page.
Download the theme folder directly from its GitHub repository and extract it into the themes
directory of your site.
Run the following command to add the theme to your site's configuration file:
Create Content
To create a new post, use the following command:
Then, open the post and change draft: true
to draft: false
in the "front matter" to publish it and make it visible.
Start the Hugo Server
Initiate Hugo's local preview server with the following command:
Open http://localhost:1313/ to view the real-time preview of your site (any changes made locally will be instantly updated).
Local Deployment
Use the following command:
This will deploy your site locally, and the output will be stored in the public
directory.
References and Acknowledgments
Original: https://wiki-power.com/ This post is protected by CC BY-NC-SA 4.0 agreement, should be reproduced with attribution.
This post is translated using ChatGPT, please feedback if any omissions.