在gitcafe中搭建自己的博客,以及在hexo中的配置

使用github page建了自己的博客,可访问速度却跟不上,啥也不说了,果断在gitcafe上也迁一份博客代码吧。

创建gitcafe page

首先要有个gitcafe账号是必须的啦,gitcafe官网戳戳戳

gitcafe上有一篇关于page建立的帮助文档,看官网戳这里
有几点注意的如下:

  • 1、创建的项目务必要与用户名相同
  • 2、创建gitcafe-pages分支
    项目pull到本地后的一系列操作
    1
    2
    3
    4
    $git checkout gitcafe-pages #切换到gitcafe-pages分支,然后新建一个index.html文件,里面随便写点东西即可
    $git add .
    $git commit -m 'first commit'
    $git push -u origin gitcafe-pages #关键,将本地分支同步到线上

配置hexo

还没入门?戳这里

在../hexo/_config.yml中,修改

1
2
3
4
5
deploy:
type: git
message: ''
repository: git@github.com:oulafen/oulafen.github.io.git
branch: master

为:

1
2
3
4
5
6
deploy:
type: git
message: ''
repo:
github: git@github.com:oulafen/oulafen.github.io.git,master
gitcafe: git@gitcafe.com:oulafen/oulafen.git,gitcafe-pages

注意:

  • 最好是配置下gitcafe和github的秘钥,git库的配置链接写成ssh的链接,不然老是输密码,手都麻了

GitCafe 已于 2016年5月31日 停止所有服务,届时在 GitCafe 的账户资料及所有项目都将被永久删除,请尽快将您的资料和项目迁移至 Coding

更多详情请戳这里