1. Go to Github to download the Hugo file and install it
Go to Github to download (64-bit or 32-bit choice)
Some students download slowly, I put a copy on the network disk -password: 9oj8
Unzip the configuration environment variable to Path
Detect
Open cmd, test statement
hugo version
The following example is a successful configuration
2. Use Hugo to generate your own blog
001_ Create a new blog folder named testblog
cd into the path you unzipped or other path,
hugo new site testblog
002_Go to the official website to find a theme you like and configure
After clicking on a topic, there will be an installation tutorial below. Here you need to install and configure git on your computer. If you haven't installed it, look for it. There are many related blogs, and the operation is very simple.
Follow his steps,,, cd into the testblog folder, git init, and then git clone
003_Start personal blog on this machine
Start Hugo with the specified theme
hugo server -t toha --buildDrafts
004_Visit local personal blog
Although it is empty, but successful! ! !
3. Write a blog and upload
Everyone has a little understanding of the md format syntax, useful,,,, create a new blog firstblog under test
hugo new test/firstblog.md
Go to find the folder, edit md (with Amway VsCode write md),
save and close and restart hugo
hugo server -t toha --buildDrafts
Visit the launch link to see the blog you just wrote
4. Deploy the blog to Github
1. Create a new warehouse on github, the name must be your github pure lowercase name +github.io, as shown in the figure
2. Upload to github using cmd
First generate the public folder, and change your baseUrl to your own name in the following command
hugo --theme=toha --baseUrl="httpss://zengxiaochao.github.io/" --buildDrafts
Then go to public to create a git repository and upload to github
cd public
git init
git add .
git commit -m "部署Hugo博客第一次测试" //提交一次
git remote add origin https://github.com/zengxiaochao/zengxiaochao.github.io.git //关联远端github仓库
git push -u origin master //推上去
When pushing, you will be asked to enter your username and password, github