hexo github

孤街浪徒 提交于 2020-01-06 17:56:46

  需要一个github帐号
https://github.com/nevereverretn

  需要github特定仓库来存储个人博客网站
username.github.io的username一定与前面的owner一致
https://github.com/nevereverretn/nevereverretn.github.io

  需要为github配置ssh key便于上传
  ssh key可以防止其他人恶意部署文件到仓库,可以不配置
  客户端生成ssh key

ssh-keygen -t rsa -C "youremail@example.com"  

  服务端设置ssh key
Settings -> SSH and GPG keys -> New SSH key,添加客户端生成的id_rsa.pub中的内容

  安装插件

$ npm install hexo-deployer-git

  如果git没有配置则全局配置

$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

  全局配置文件 ..\博客根目录 _config.yml
  上传github设置

deploy:
  type: git
  repository: git@github.com:nevereverretn/nevereverretn.github.io.git
  branch: master

  生成并上传

$ hexo d -g 

  国外网站,速度你懂的

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!