first-blog
Welcome to my blog! This is my first blog, but not my last blog. This blog will revolve around how I created a blog based on hexo and sent it. Also some of my little learning experience.
Git and Node
链接:https://pan.baidu.com/s/1p80wxB4nA45LzgiqbOYZRA?pwd=6666
提取码:6666
This package has two apps Git-2.37.1-64-bit and node-v16.16.0-x64.Just like you mind,next next and next.But you’d better remember where to download it from.
install Hexo
Enter cmd input order
1 | npm install -g hexo-cli |
Creat a folder on the table,Right-click the folder and select Open it with git bash
So let’s initialize hexo
1 | hexo init |
Before initialization, you need to make sure that the environment variable is added (the path to the bin directory in your blog file is added to the environment variable)
Enter the code to check whether the startup is successful
1 | hexo s |
The website can be opened according to the URL
1 | localhost:4000 |
Deploy hexo to GitHub
Create a personal account on github
First, you need to have a github account. After logging in to the account, create a warehouse: the warehouse name is your username.github.io,
Examples are as follows:
Create a repository with the same username as yours, followed by.github.io,
Only in this way, when you want to deploy to GitHub in the future, it will be identified, that is, xxxx.github.io, where xxx is your registered GitHub user name
生产SSH到GitHub上
Open the cmd window and run the following command
1 | git config -- global user.name"your githib name" |
Enter your GitHub username in yourname and your GitHub email in youremail. That way GitHub knows if you have a corresponding account. The user name is the warehouse name, and the email address is the github registration email address. The following is an example:
Prevent typing errors can be checked
1 | git config user.name |
Then go to your home directory: C:\Users\libinbin, right click to open git bash and type:
1 | ssh-keygen -t rsa -C 2412757158@qq.com |
Then you sign up for github and hit enter three times
Then you will find an.ssh directory under C:\Users\libinbin, which has a public key and a private key. id_rsa.pub is the public key, we need to open it and copy the contents.
Key acquisition mode
Click on the repository you just created and copy

Then go to github:click setings
Find that we need a key, we just copied the key in the glue, title whatever
Click Add SSH Key
deploy
In this step, we can associate hexo with GitHub, that is, deploy the hexo-generated articles to GitHub, open the site configuration file _config.yml, flip to the end, and modify it as
YourgithubName is your GitHub account
Modifying a configuration file
revise content:
1 | deploy: |
Find your own blog path to open
图片
At this point, you need to install deploy-git, which is the deployment command, so that you can use the command to deploy to GitHub.
1 | npm install hexo-deployer-git --save |
If a message is display``ed, the node environment configuration is incorrect or the command path is incorrect
Then execute the following commands in sequence
1 | hexo c #清除缓存文件 db.json 和已生成的静态文件 public |
If the system asks you to reply yes or no, then the installation is correct
Finally, go back to the gitbug repository to see if the file was generated and determine whether it was successful