Successfully installed hexo on github

Yu Yi
Wandering the Jianghu

1 Local environment construction

Install software:
Install Git( https://git-scm.com/
Install node.js( https://nodejs.org/en/

2 Local installation and initialization of the blog framework hexo

Create any folder (blog directory) in any disk
Right click the created folder and select Git Bash Here to enter the command interface
Execute the following command:
To install the hexo blog framework command: npm install -g hexo-cli
Check whether the installation is successful: hexo -v (Version information indicates successful installation)
Initialize local folder: hexo init (If the initial file is successful, INFO Start blogging with Hexo! Will appear.)
Execution: hexo s -g (Local preview) The preview address is: localhost: 4000. If the preview is successful, it means success.
Stop Preview Ctrl+C Stop
After stopping, enter: hexo clean When the local cache is cleared (INFO Deleted database.), it indicates that the clearing is successful.

3 Select the code hosting platform to deploy the blog

With github( https://github.com/ )As an example
3.1: Log in to github and create a new project.
Note: The name of the project library must be consistent with the owner's name (e.g. XXXX. github. io) XXX is your owner's name
3.2 Binding User Name and Email to Git
Execute the following command: git config --global user.name "name"
Note: the name in "name" is your own user name
Binding mailbox: git config --global user.email "x xx@qq.co m"
Note " xxx@qq.com ”In xxx@qq.com For your own mailbox

4: Binding SSH

4.1 Generating SSH files:
ssh-keygen -t rsa -C “ xxx@qq.com
Note:“ xxx@qq.com ”For your own mailbox
Prompt: press Enter three times after entering the command
The directory of the. SSH file is: CUsers username. ssh
4.2 Open id_rsa.pub under the. ssh file with a professional code editor to extract the secret key
4.3 Put the secret key content of id_rsa.pub into github
Process: github user settings>click SSH and GPG keys>New SSH key on the left to add the key directly. Note can be left blank. OK.
4.4 Test whether adding ssh is successful
ssh -T git@github.com
Enter the above command: yes

Final deployment of 5hexo

5.1 Open the local blog directory, find the _config.yml editor, open it, find the last line, and delete the content after deploy:
Add the following code:
type: git
repo: github@github.com :xx/xxx.github.io.git
branch: master
Note: Please replace (repo:“ github@github.com : xx/xxx. github. io. git "is replaced by the SSH address of your github) deploy: must be associated with the above code
5.2 Installing and deploying plug-ins: npm install hexo-deployer-git --save
5.3: Deployment Upload: hexo d -g

Reward three share
comment (5)
Private comments
  1. Welcome to join

    June 20, 2023 reply
  2. Practical articles, Uncle Bird has put them in the browser's favorites, and we'll do it later

    May 9, 2022 reply
  3. Now many bloggers have done this, and they also want to have fun.

    February 18, 2021 reply
    1. @Lao Zhang's Blog

      It's OK to deploy on vercel instead of local deployment

      February 18, 2021 reply
    2. @Lao Zhang's Blog

      Yes, I can't install anything else. It's very complicated. Not as convenient as wp

      February 18, 2021 reply