Step 0: My Assumptions
- You know how to open a command prompt window.
- You’re running a 64-bit version of Windows.
- Your website is
example.com. - You will use
D:\Hugo\Sitesas the starting point for your site.
Step 1: Setup Your Directories
You will need a place to store the Hugo executable, your content (the files that you build), and the generated files (the HTML that Hugo builds for you).
- Open up Windows Explorer.
- Create a new folder,
D:\Hugo. - Create a new folder,
D:\Hugo\bin. - Create a new folder,
D:\Hugo\Sites.
Step 2: Download the pre-built Hugo executable for Windows
- Open https://github.com/spf13/hugo/releases in your browser.
- The current version is hugo_0.12_windows_amd64.zip.
- Download that ZIP file and save it in your
D:\Hugo\binfolder. - Find that ZIP file in Windows Explorer and extract all the files from it.
- You should see a
.exefile with the same name as the ZIP file. - Rename that
.exefile tohugo.exe. - Verify that the
hugo.exefile is in theD:\Hugo\binfolder. (It’s possible that the extract put it in a sub-directory. If it did, use Windows Explorer to move it toD:\Hugo\bin.)
Step 3: Verify the executable.
- Open a command prompt window.
- At the prompt, type
D:\Hugo\bin\hugo helpand press the Enter key. You should see output that starts with:
A Fast and Flexible Static Site Generator built with
love by spf13 and friends in Go.
Complete documentation is available at http://gohugo.io
If you do, then the installation is complete. If you don’t, double-check the path that you placed the hugo.exe file in and that you typed that path correctly. If you’re still not getting the output, post a note on the Hugo discussion list (in the Support topic) with your command and the output.
Step 4: Generate your first site
- Open a command prompt window.
- At the prompt, change your directory to the
Sitesdirectory.
C:\Program Files> cd D:\Hugo\Sites
C:\Program Files> D:
D:\Hugo\Sites>
- Run the command to generate a new site. I’m using
example.comas the name of the site.
D:\Hugo\Sites> D:\Hugo\bin\hugo new site example.com
Note that you must type the full path to hugo unless you’ve updated your system PATH variable!
4. You should get output similar to the following: TODO: grab output and put here
You now have Hugo installed and a site to work with. You need to add a layout (or theme), then create some content. Go to http://gohugo.io/overview/quickstart/ for steps on doing that.
Troubleshooting
@dhersam has a nice video on common issues at https://www.youtube.com/watch?v=c8fJIRNChmU
Future Steps
Consider adding D:\Hugo\bin to your system PATH. TODO: add link to article on updating PATH in Windows.