Getting Started With Hugo
Contents
I will outline how I set up my Hugo installation which varies slightly from Hugo’s quick start guide.
Install hugo.exe
- Create a new folder
C:\Program Files\Hugo
- Download the latest zipped Hugo executable from Hugo Releases.
- Extract zip file contents into the folder
C:\Program Files\Hugo
. - Update the PATH environment variable to include
C:\Program Files\Hugo
.- I used the control panel to do this.
- Control Panel\System and Security\System
- Advanced system settings on the left
- Advanced tab
- Environment Variables button
- I used the control panel to do this.
- Open a command prompt and type
hugo help
to verify it is working.
Create a new website
- Create a new folder for the source code
C:\repos\hugo
- Open a command prompt to create a new website, add a theme, and create a content file.
|
|
- Add the theme to the site configuration file, config.toml.
- Add a new line with the text
theme = "ananke"
.
- Add a new line with the text
- Add content to the content file, content/posts/getting-started-with-hugo.md.
- When you are ready to deploy the content, change
draft: true
todraft: false
in the content file.
Start local server
- Start the local Hugo server to test,
hugo server
, use-D
to include drafts. - Navigate to the new site at http://localhost:1313/
Build static pages for deployment
- At the command prompt type
hugo
- The output will be in the
public
folder. - Copy the files to your web host. I’m using an S3 bucket on AWS to host my site.