premise:
1. Create a github repository
2. Node.js installation configuration
3. Installation Configuration Git
premise
1. Create a new github repository
- Open github website , (Registration) login account, create a new warehouse ;
Note: name == warehouse requirements, yourname.github.io; ==
勾选Initialize this repository with a README;
- After the completion of the new warehouse opens, click on the right button settings, open the following GitHub Pages;
- Source saved as master branch, after the link above is the link to access the blog
Step 2. Install Node.js
Open Node.js official website to download the corresponding operating system version and the median node.js
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
Open Git's official website to download the corresponding operating system version and git-digit
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
Configure git
The right mouse button to open the git bash here (the following commands are executed in git bash)
Git set of user name and email (the first time)
git config --global user.name "yourname" git config --global user.email "youremail"
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
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
Verify whether to add ssh success
ssh -T [email protected]
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
To find a suitable location to create a new folder must be empty. Examples folder: D: \ Blog
Open cmd, enter the new file
d: cd Blog
Installation hexo
npm install hexo -g
Verify that the installation was successful
hexo -v
Configuration Hexo
Initialization Blog folder
hexo init
Install the necessary components
npm install
Build directory structure
hexo g #或 hexo generate
Open hexo service, the preview interface
hexo s #或 hexo server
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