Multi-platform Blog Hosting with GitHub and Coding

· 2 min read

GitHub provides static page hosting services, so I’ve always used GitHub to host my personal static blog.

On GitHub, I created a user repository with the master branch for static pages and the source branch for blog source code.

The blogging workflow is:

  1. Write locally, push to source branch
  2. Travis-CI detects source branch changes, builds and updates the master branch

Overall, this is very convenient, but GitHub blocks Baidu crawlers. Since Baidu is still widely used in China, not being indexed by Baidu is quite frustrating. So I had to consider mirroring a static site to a domestic platform or rent my own server for hosting.

I chose to use Coding for two main reasons:

  1. Fast speed
  2. Supports custom domains

Implementation Strategy

Creating Coding Account

Recommend using the same username as GitHub, though different names work too. Just note that the repository name must match the account name to support {user_name}.coding.me access.

Add Multiple Upstream Repository Addresses Locally

Push Static Pages to Coding Main Branch

$ git push coding master

Enable Pages Service and Configure Custom Domain

Add Baidu Route Resolution to Alibaba DNS Domain Resolution

Note: I only want to solve the issue of Baidu crawlers being unable to index, so I only set the Baidu search route to go through the Coding site.

Final Thoughts

After the above configuration, Baidu crawlers can normally access our website, and Baidu indexing will be OK.