1. Download the Hugo
Download Hugo and unzip it into the designated folder
2. Add the environment variable PATH
System – Advanced System Settings – Environment Variables – Add Hugo path to system variable path. Restart the terminal to view the Hugo version
3. Open theWebsite home pageTo set up, click Quick Start to enter Step1-Step7
Step1: done, start directly with step2
Step2: type in the directory you want to create
Hugo new site williamwang123.github. IO // QuickStart changes to its own Github repository nameCopy the code
step3
cdwilliamwang123.github.io git init git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke // Ananke here is your theme, you can choose to change the appropriate theme laterCopy the code
echo 'theme = "ananke"' >> config.toml
Copy the code
Step4: Add some content: xxx.md file, the name of the custom line
hugo new posts/my-first-post.md
Copy the code
Open the MD file to add content and change Draft to False to make the draft visible
Step5: start Hugo server
hugo server -D
Copy the code
http://localhost:1313/
The preview page
Step6: Modify the config file, change languageCode to Chinese: zh-Hans, and change the title title
http://localhost:1313/
step7
hugo -D
Copy the code
First create a terminal, CD to enter the file
After running, the folder creates a new public directory. The public directory is a website, but it cannot use file protocol preview, it needs to use Hugo Server preview
4. Put your page online
Create a.gitignore file in the outermost directory and type /public/ to tell the current repository not to store it
The add and commit
Save and close
Create a repository on Github and upload content from public