This is the third day of my participation in Gwen Challenge
I love three things in this world.Sun,moon and you.Sun for morning,moon for night,and you forever. I love three things in this world. Sun of day, moon of night, thou eternal.
My blog, not seen for a day, still missing.
Ha ha, xiaobian nothing made up a few old sayings, write not so good, please forgive me.
Next, let’s talk about the blog’s follow-up (the first two stations can be seen in the column). Yesterday, we have successfully run our blog locally, so how can we make others access our blog?
1. Deploy your blog to Github Pages
First of all, we need a Github account. If you don’t have one, you can register it at github.com/. After registering, you need to click ➕ in the upper right of Github to create a New repository.
Git Git Bash Here to open your first new Blog file:
Ssh-keygen -t rsa-c “your [email protected]” fill in the quotation marks with your email address, for example, mine is *********@qq.com
The following screen pops up (press enter until the key pattern appears) :
Then type the following command to copy the key (note the space) :
clip < ~/.ssh/id_rsa.pub
2. Configure the SSH key on Github
- Log on to GitHub, click on the image in the upper right corner, and go to Settings.
- Go to the left and click SSH and GPG Keys;
- Then hit New SSH key;
- Paste the key in the key area with a random key name (for example, the blog key).
3. Test run
We continue with the following command in Git (the command does not need to be changed) :
ssh -T [email protected]
After running the command, we should see the following page:
Enter yes. If the following page is displayed, the configuration is successful.
Wow, feels closer and closer to success, hee hee.
4. Configure the information on Git
Git will record the submission according to the user’s name and email address. GitHub also uses this information for permission processing, so we need to enter the following command to set the information, change the name and email address to your own. The name may not be the name of GitHub, but for easy memory, it is recommended to keep the same as GitHub. Enter the following command:
Git config --global user.name git config --global user.name
Git config --global user.email
5. Configure file information
Open the repository on Github as shown below. And click on the little symbol to the right of Code, Use SSH, and then copy next to it (circled in red)
Then open the Hexo folder and find the following circled file (right click to open with Notepad) :
To: The image file can also be opened with an editor, such as Sublime.
Flip back to the config.yml file to find the following configuration:
In addition to copying part of the different, the rest of the small editor can be changed to the same. (Note that the colon: is followed by a space, and you need to enter: oh, otherwise an error may be reported. Also need to pay attention to indentation, remember not to arbitrarily modify the position of the statement, otherwise the consequences.
6. Push your blog files to Github
Finally we need to push the file to Github, right click on the Hexo file, open Git Bash Here, and type the following command:
hexo g
hexo d
Or just type hexo g-d
From now on, we will input:
Hexo clean // Cleans the cache so that the effect is displayed as soon as possible after each change
Hexo clean && hexo G-d
Now type hexo g-d. If you are asked to enter your Github account and password, your blog files have already been deployed to Github.
To: If an error is reported, and the error is:
So your deployer is not installed yet. You need to enter the following command to install:
npm install hexo-deployer-git --save
Another thing to note on Github is that the circled section must beBranch: master
. Otherwise, an error will be reported.
Finally, we can copy the following url section to the browser input link, then we can view our own blog. You can also use your own url, such as https:// your username.github. IO /. Bob 0912.github. IO /
Now everyone can access you via your blog link.
Last word: Don’t underestimate every little thing you do in your life. It’s the best preparation for your future.