hexo博客爬坑日志(三)

178 阅读1分钟

前言

(这是我大学时写的博客,现转移至掘金。旧博客地址:jimengkui.cn/)

将hexo生成的静态博客hexo文件部署到github page上

创建仓库

github上新建一个名为你的用户名.github.io的仓库,比如说,如果你的github用户名是test,那么你就新建test.github.io的仓库(必须是你的用户名,其它名称无效)。

将hexo部署到Github上

打开站点配置文件 _config.yml,翻到最后,修改为YourgithubName,就是你的GitHub账户

deploy:
  type: git
  repo: https://github.com/YourgithubName/YourgithubName.github.io.git
  branch: master

然后要安装一个deploy-git的插件

npm install hexo-deployer-git --save

然后

hexo clean
hexo generate
hexo deploy

注意deploy时可能要你输入username和password。

过一会儿就可以在yourname.github.io 这个网站看到你的博客。

成品展示(旧博客地址):jimengkui.cn/

参考博客链接:blog.csdn.net/sinat_37781…