☀️

Hi, I am Miao.

something about gitpage

Deploy your GitHub Pages

Install git and node.js by yourself

git

node.js

Something that should be done first with git
  • Open Git Bash and configure your identity
$ git config --global user.name "sunmiao0301"
$ git confit --global user.email "hfut_sm@163.com"
  • Check with cmd below
$ git config --global user.name
sunmiao0301
$ git confit --global user.email
hfut_sm@163.com
  • Create your repo for GitHub Pages
$ cd d:
$ mkdir repo
$ cd repo
$ git init
  • Check your installation of node.js with cmd below (Reboot your PC if there is sth wrong in this step)
$ node -v
v16.13.1
$ npm -v
8.1.2
Open up the terminal and run
$ cd ~/.ssh && ssh-keygen
$ cat id_rsa.pub | clip
Add your key to your account via github.com
$ ssh git@github.com

install Hexo and initial your first blog in localhost

$ cd d:/repo
$ npm install -g hexo-cli
$ hexo init sunmiao0301.github.io
$ cd sunmiao0301.github.io
$ hexo g
$ hexo s

deploy your first blog to GitHub Pages

  • Open the file in D:\repo\sunmiao0301.github.io_config.yml (the path for me)

  • At the end of this file, replace the deployment with:

    deploy:
      type:git
      repo:https://github.com/sunmiao0301/sunmiao0301.github.io.git
      branch:main
  • Save and check with:

$ cd d:/repo/sunsunmiao0301.github.io
$ npm install hexo-deployer-git --save
$ hexo clean
$ hexo g
$ hexo d

Change your theme if you like

$ cd d:/repo/sunsunmiao0301.github.io
$ git clone https://github.com/tiaanduplessis/hexo-theme-brewski.git themes/brewski
$ npm install --save hexo-renderer-pug hexo-generator-feed hexo-generator-sitemap
  • Edit the extensions in your file (path is D:\repo\sunmiao0301.github.io_config.yml for me)

    theme:brewski

    Last step — unnecessary

  • Delete the folder D:\repo\sunmiao0301.github.io.deploy_git, then:

$ hexo clean
$ hexo g
$ hexo d

Deploy at another device

copy and paste
$ hexo clean
$ hexo g
$ hexo d

— Jan 5, 2022

Made with ❤ and Hexo.js