/images/avatar.jpg

How to use Hugo to Build a Blog and Deploy it to Github Page

1. Install Hugo

  • Windows:

First install the choco package manager, run cmd under administrator rights, and execute the following command:

1
2
3
4
powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"

# Set environment variables
SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Then use choco to install hugo:

choco install hugo -confirm

  • MacOs:

Install using brew command:

brew install hugo

  • Linux:

Install using snap command:

snap install hugo

Check whether the installation is successful:

Enter: hugo version. If the version information appears, the installation is successful.