前端小白前端
windows用户git
懒癌晚期患者github
一个Github帐户npm
安装Gitwindows
安装Node.jsbash
Step 1, 建立一个Github page
Repo name 的填写格式为
Github名 + github.io
。举个栗子,个人repo name为cnscorpions.github.io
服务器Description能够写
static blog/blog
,反正你随意就好网络点击建立repohexo
Step 2, Hexo安装以配置 (假设你已经安装好Git和Node.js)
打开Git bash命令行ssh
安装NPM ---> Taobao NPM 镜像 (由于网络环境很差,你懂的)
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
安装Hexo
$ cnpm install -g hexo-cli
建立blog根目录
$ hexo init blog
生成静态文件
$ hexo g
安装Hexo-server模块
$ cnpm install hexo-server --save
运行本地服务器 (必定要在blog根目录下运行)
$ hexo s
打开
http://localhost:4000/
已经能够看到一篇内置的blog了Step 3, 安装Hexo主题 (Git在线安装 VS 本地安装)
Git安装
$ hexo clean $ git clone https://github.com/iissnan/hexo-theme-next
修改配置文件
_config.yml/theme ---> next
更新主题
$ hexo c $ hexo g $ hexo s
Step 4, 安装SSH
安装hexo-deployer-git模块
$ cnpm install hexo-deployer-git --save
修改配置文件
deploy: type: git repo: https://github.com/cnscorpions/cnscorpions.github.io.git branch: master
检查电脑中是否存在SSH key
$ ls -al ~/.ssh
建立新的SSH key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter] ---> 不要移动文件位置 Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
复制id_rsa.pug
复制到Github SSH key
搞定
$ hexo g ---> $ hexo d ----> OVER
PS: 暂时先这样了,欢迎拍砖!