A, hexo + github to build the process of recording personal blog

premise:

1. Create a github repository

2. Node.js installation configuration

3. Installation Configuration Git

premise

1. Create a new github repository

  1. Open github website , (Registration) login account, create a new warehouse ;

Note: name == warehouse requirements, yourname.github.io; ==

​ 勾选Initialize this repository with a README;

  1. After the completion of the new warehouse opens, click on the right button settings, open the following GitHub Pages;
  2. Source saved as master branch, after the link above is the link to access the blog

Step 2. Install Node.js

  1. Open Node.js official website to download the corresponding operating system version and the median node.js

  2. It is available through the following command to verify the configuration after installation has been successfully (installed by default automatically configured environment variables)

    node -v
    npm -v

Step 3. Install git

  1. Open Git's official website to download the corresponding operating system version and git-digit

  2. After installation it can be verified by the command is successful configuration (installed by default automatically configured environment variable, select use Git from the Windows Command Prompt)

    git --version
  3. Configure git

    1. The right mouse button to open the git bash here (the following commands are executed in git bash)

    2. Git set of user name and email (the first time)

      git config --global user.name "yourname"
      git config --global user.email "youremail"
    3. Configuring ssh

      #生成密钥,默认存储路径:C:\User\Administrator\.ssh
      ssh-keygen -t rsa -C"youremail"
      #添加密钥到ssh-agent
      eval "$(ssh-agent -s)"
      #添加生成的SSH key到ssh-agent
      ssh -add ~/.ssh/id_rsa
    4. Add ssh key on github.

      #步骤1
      登录github,点击头像下的settings
      #步骤2
      打开左侧的SSH and GPG keys
      #步骤3
      点击右侧的new SSH key
      #步骤4
      Title 自定义
      Key输入刚才生成的C:\User\Administrator\.ssh路径下的id_rsa.pub
    5. Verify whether to add ssh success

      ssh -T [email protected]
    6. ssh-key configuration failed Solution

      首先,清除所有的key-pair
      ssh-add -D
      rm -r ~/.ssh
      删除你在github中的public-key
      
      重新生成ssh密钥对
      ssh-keygen -t rsa -C "[email protected]"
      
      接下来正常操作
      在github上添加公钥public-key:
      1、首先在你的终端运行 xclip -sel c ~/.ssh/id_rsa.pub将公钥内容复制到剪切板
      2、在github上添加公钥时,直接复制即可
      3、保存

Small scale chopper

hexo + github settings

Installation Hexo

  1. To find a suitable location to create a new folder must be empty. Examples folder: D: \ Blog

  2. Open cmd, enter the new file

    d:
    cd Blog
  3. Installation hexo

    npm install hexo -g
  4. Verify that the installation was successful

    hexo -v

Configuration Hexo

  1. Initialization Blog folder

    hexo init
  2. Install the necessary components

    npm install
  3. Build directory structure

    hexo g
    #或
    hexo generate
  4. Open hexo service, the preview interface

    hexo s
    #或
    hexo server
  5. First visit

    Access: localhost: 4000, you can see the page loads.

Hexo contact Github

Open hexo profile; D: \ Blog \ _config.yml

At the end of the configuration file:

repository: Open github repository click Clone or download, copy the address of the warehouse inside ssh corresponding;

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repository: [email protected]:username/username.github.io.git
  branch: master

Guess you like

Origin www.cnblogs.com/tassel/p/10961906.html