记录一下搭建博客
1. 配置
# 安装:node.js、git
# 创建博客文件夹
- hexo init
# 安装依赖包
- npm install
# 本地调试 浏览器中输入 localhost:4000
- hexo generate
- hexo server
# 创建 用户名.github.io 仓库
# 编辑本地Hexo目录下文件_config.yml,在最后添加如下代码
deploy:
type: git
repository: http://github.com/用户名/用户名.github.io.git
branch: master
# 部署到github
- hexo generate
- hexo deploy
# 生成SSH
ssh-keygen -t rsa -C "1105128664@qq.com",一路回车
找到本用户下的C:\Users\${username}\.ssh\id_rsa把里面的内容复制
在github上面对应的仓库点击Setting,然后点击Deploy Keys
黏贴刚才的内容,Allow write access 打钩,点击Add Key
# 测试上传
ssh -T git@github.com,即使报错也一路点yes,至此配置成功
git config --global user.name "yourusername"
git config --golbal user.email "youremail"
配置以上两个去掉很多警告
大约 1 分钟