Luoml's blog

将Hexo博客同时部署到GitHub和Coding

Hexo搭建个人博客并部署到GitHub的步骤可参考我的上一篇文章《Hexo+Github搭建个人博客》
以下主要介绍将博客部署到Coding:

  1. 注册Coding账号,并配置SSH密钥(配置步骤同上篇文章)
    ssh-key
  2. 创建项目,项目名最好与用户名一致,这样才能直接通过xxx.coding.me直接访问你的网站
    注意:类型一定要选择公开,否则不能开启Pages服务,更不能访问网站
    coding-create
  3. 新建coding-pages分支,并设置为默认分支。
    branch
  4. 开启Coding Pages服务并绑定自定义域名
    Coding Pages
  5. 修改Hexo根目录下的_config.yml文件,编辑deploy项:

    1
    2
    3
    4
    5
    deploy:
    type: git
    repo:
    github: git@github.com:luoml/luoml.github.io.git,master
    coding: git@git.coding.net:luoml/luoml.git,coding-pages
  6. 新建CNAME文件到Hexo\source目录,文件中写入希望绑定的域名
    CNAME

  7. 发布到GitHub和Coding

    1
    2
    hexo clean
    hexo d -g
  8. 访问
    通过 luoml.github.ioluoml.coding.me均会直接跳转到 luoml.coding.me
    blog

Fork me on GitHub