Installing HUGO
Download
From the site above, download and extract the Windows module that matches your environment. In my case, I downloaded “hugo_0.102.3_Windows-64bit.zip”.
Extract
Extract the downloaded zip file and copy the hugo.exe inside it to a folder, for example, C:\bin.
Register to Environment Variables
Register it to the environment variables so that you can run hugo.exe from anywhere. This is the operation on Windows 11, but I think it can be registered with the following steps.
- Press Win+Pause to open the About page
- Click Advanced system settings
- Click Environment Variables
- Select Path and click Edit
- Click New, enter “C:\bin” on a new line, and click OK to close the dialog
Preview the Blog
In the command prompt, navigate to your HUGO blog folder and run the following command.
hugo server -D
The execution result is as follows. (The -D option is for displaying draft articles.)
| |
The address will be output when executed (in the example above, http://localhost:1313/), so copy the address to your browser.
The preview will automatically update every time you save a file.
To end the preview, press Ctrl+C in the command prompt.
![Featured image of post [HUGO] Display Preview in Local Environment](/p/hugo%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%81%A7%E7%92%B0%E5%A2%83%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%83%97%E3%83%AC%E3%83%93%E3%83%A5%E3%83%BC/img_hu415dc7e70376ac350673d0366f70ca4b_19909_800x0_resize_box_3.png)