Problems and solutions when building a personal blog based on hexo and hosting it on github

Written before:

Reference for this article

Teach you step by step how to build your own personal blog from scratch | pit-free version video tutorial | hexo

Hexo builds a personal blog (1)
hexo builds a personal blog (2)

The specific steps have been written in detail in the video and article above, but because I am running a Windows system here, I encountered different problems than the above, including

The first pit

When it comes to deploying to GitHub, hexo dthe following error appears when running (I still use cmd here)

image-20211205164101080

After searching online for a long time, it seems that the problem is that git does not configure environment variables. You can choose to add the configuration again, or directly download Git and run it in git bash. Based on various factors (the bash command line is more friendly to me and I just want to adjust the location of the blog file because I am new to it), I chose to download Git directly.

You can download it from Git official website

But it’s generally very slow in China. For example, I couldn’t get in directly here, so I found this Git mirror.

The installation steps are the same as those of ordinary software. You can refer to Installing Git under Windows 10.

The second pit

.\blog\_configAfter configuring your GitHub warehouse information in the file, run it directly and hexo dit will appear.

image-20211205170537606

In fact, the picture has already given a hint, you need to tell it who I am first, hexo dtype two lines before

$ git config --global user.email "你的GitHub注册邮箱"

$ git config --global user.name "你的GitHub昵称"

image-20211205170926798

The third pit

git configAfter typing the configuration command in the second pit above, I still hexo dget the following error message:

image-20211205194614400

At this time, check the network, such as refreshing your GitHub homepage to see if the connection is normal and what the speed is. I finally found that it was mainly a network problem. I hung up the ladder and solved it directly. After success, the display is as hexo dfollows

image-20211205194427235

Then enter hexo sstart

image-20211205194700060

At this time, enter https://twocanis.github.io/(taking my own ID as an example), wait for two seconds and refresh the interface (the connection refresh here requires response time), and it will be displayed normally and can be provided as an external link URL for others to access.

image-20211205194851712

Guess you like

Origin blog.csdn.net/twocanis/article/details/121734285