Hugo personal blog construction|Github deployment of Hugo personal blog|Blog framework based on GO language|Personal blog construction under Windows|Easier personal blog than Hexo

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

Insert picture description here

Unzip the configuration environment variable to Path

Insert picture description here
Insert picture description here
Insert picture description here

Detect

Open cmd, test statement

hugo version

The following example is a successful configuration
Insert picture description here

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

Insert picture description here
Insert picture description here

002_Go to the official website to find a theme you like and configure

Insert picture description here
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.
Insert picture description here

Follow his steps,,, cd into the testblog folder, git init, and then git clone
Insert picture description here
Insert picture description here

003_Start personal blog on this machine

Start Hugo with the specified theme

hugo server -t	toha --buildDrafts

Insert picture description here

004_Visit local personal blog

Insert picture description here
Although it is empty, but successful! ! !
Insert picture description here

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

Insert picture description here
Go to Insert picture description herefind the folder, edit md (with Amway VsCode write md),
Insert picture description here
save and close and restart hugo

hugo server -t	toha --buildDrafts

Visit the launch link to see the blog you just wrote
Insert picture description here

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

Insert picture description here
Insert picture description here

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

Insert picture description here
Insert picture description here
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                //推上去

Insert picture description here

When pushing, you will be asked to enter your username and password, githubInsert picture description here
Insert picture description here

2. Visit the public blog

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41170600/article/details/107007666