Use Github + Hexo build personal blog - Hexo station (a)

First, build a blog


1.1.1 Installation nodejs

Official website: https://nodejs.org/en/
After downloading, open the can has been the next step.

To see if the installation was successful

$ node -v
v12.10.0

1.1.2 install Git

Windows: Download and install https://git-scm.com/download/win

1.1.2.1 git settings

Configure push the user name and mailbox

$ git config --global user.name “github’s Name”
$ git config --global user.email “[email protected]”
$ git config --list

Generate ssh key file:

$ ssh-keygen -t rsa -C "github的注册邮箱"

Found under the C drive User→用户名→.ssh→id_rsa.pub
to copy the contents inside to github user avatar in settingthe SSH and GPG keysNew SSH keyinside
Here Insert Picture Description


1.2 download source replacement

Download cnpm by npm, to improve download speeds of Hexo

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

After downloading the source for good,

1.3 Installation Hexo

$ cnpm install -g hexo-cli

1.4 build blog

First find a path, a new folder to hold the files created Hexo

$ mkdir blog

Initialization Hexo

$ hexo init

Two, github set


2.1 to create a new warehouse

Warehouse's name and account name consistent
Here Insert Picture Description
set a theme
Find the setting, to pull down, to find Github Pages, select a topic, and then determine
Here Insert Picture Description
Here Insert Picture Description

1.5 push to github blog

  1. Installation hexo-deployer-git
    $ npm install hexo-deployer-git --save
  2. Edit _config.yml file
    deploy:
    type: git
    repository: github上仓库的ssh的地址
    branch: master
    
    Here Insert Picture Description
  3. Local Deployment blog
    hexo s
    URL input: localhost:4000you can
  4. Remote push Website
    • As an exception occurs due to the cache, clear the cache command can be executed before generating the command:hexo clean
    • Generate static files: heox generate
    • Pushed to the website: hexo deployordexo d

[Reference link]:
6. One-the Command Deployment
7. HEXO official document
8. NexT theme official website

He published 190 original articles · won praise 153 · views 90000 +

Guess you like

Origin blog.csdn.net/qq_36852780/article/details/104593033